ruby on rails - routing error showing that No route matches [POST] "/admin/locations/1" -


When I edit my location, I'm new to ROR, it will give me the following error No [POST] "/ Admin / places / 1"

Here I am using Rail 3.2.12

This is My Location Controller

  class admin :: Location controller & lt; ApplicationController def index @ location = location.order ("location desc") end DEF New @ location = location. Make new end DEIF @ location = location.NEW (PARAM [: location]) if @ location.save # flash [: notice ] = 'Successfully added to the location list.' Redirect_to: Action => 'Index' and render: action = & gt; 'New' end end def edit @location = location.find (params [: id]) end def update @location = location.find (params [: id]) if @ location.update_attributes (param [: location]) #flash [: Notice] = 'The category has been successfully updated.' Redirect_to: Action => 'Index' and render: action = & gt; 'Index' end and end   

this is my edit.html.erb

  & lt; H2 & gt; Edit Location & lt; / H2 & gt; & Lt;% = simple_form_for (: location ,: url = & gt; {: action = & gt; 'update',: id = & gt; @ location.id}) do | F | & Gt%; & Lt;% = Render (: partial = & gt; 'form' ,: local = & gt; {: f = & gt; f})%> & Lt;% = submit_tag ("Update",%) & Lt;% = link_to ("cankal", {: action => 'index'})%> & Lt;% end% & gt;   

And this is my route. RB

  GuestHouse :: application.routes.draw Please devise_for: Customer name: Administrator resource: End of locations < / Code>  

and in my index.html.erb & lt;% = link_to ("edit", {: action = & gt; 'edit' ,: id = & gt; location.id } ,: class = & gt; BTN BTN-info ')%>

  <% = simple_form_for (: location :: url = & gt; Action = & gt; 'update' ,: id = & gt; @ location.id} ,: method = & gt; 'put') f | F | & Gt%; Pass the method in   

simple_form_for

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -