I have two methods in PersonsController- edit and update and a Person model:
def edit
@person=Person.find(params[:id])
end
def update
@person=Person.find(params[:id])
@person.update_attributes(params[:person])
end
and my edit.html.erb:
<h2> Edit info here!</h2>
<%= @person.name %>
<%= form_for @person, html: {mulitpart: true} do |f| %>
<p><%= f.text_field :location %></p>
<p><%= f.submit :submit , class: "btn btn-large btn-success" %></p>
<% end %>
and routes.rb:
resources :persons
But when I submit the form I get:
AbstractController::ActionNotFound
The action '5231d2491dba7fb057000004' could not be found for PersonsController
The 5231....... is id of a person.
Request Parameters:
{"utf8"=>"✓", "_method"=>"put", "authenticity_token"=>"3TL7nn4UxhxFoxETeooBMThhkE0VdMoGFpjN9sx4srk=", "person"=>{"location"=>"nagpur"}, "commit"=>"submit", "controller"=>"persons", "action"=>"5231d2491dba7fb057000004"}
What is wrong here? I'm using mongoid and rails 3.2.13.