Reputation: 8631
I have my nested route setup as follows:
resources :clients do
resources :contacts
end
and my update action form as so:
= form_for @contact, :url => client_contacts_path(@contact.client), :html => { :multipart => true } do |f|
however when I go to save I get this error:
No route matches [PUT] "/clients/3/contacts"
I'm not quite sure why it isn't trying the route: /clients/3/contacts/:id
what am i missing from my form?
Upvotes: 0
Views: 38
Reputation: 6931
Try to change your form_for call to:
= form_for [@client, @contact], :html => { :multipart => true } do |f|
Rails will figure out all it need by it self:
More info about form_for.
Upvotes: 2