I have FamiliesController with these actions:
def edit
@family=Family.find(params[:id])
end
def update
@family=Family.find(params[:id])
@family.update_attributes(params[:family])
end
Family model: (Using Mongoid)
attr_accessible :location
field :location
edit.html.erb
<div class="container">
<%= form_for @family do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :location %><br />
<%= f.text_field :location %>
</p>
<%= f.submit "Submit" %>
</div>
rotues.rb
resources :families
But when I submit the form I get:
AbstractController::ActionNotFound at /families/5235513e1dba7f8605000004
The action '5235513e1dba7f8605000004' could not be found for FamiliesController
(5235513e1dba7f8605000004) is id of the person
What is wrong here?
EDIT
So I found out on SO and it looks like Rails does not support alphanumeric IDs Also the gem mentioned in the answers don't work in mongoid (they are only for ActiveRecord models). So how to sort out this issue for Mongoid?
Does that mean I cannot use the Rails update method to update my database records in Mongoid?