Reputation: 518
routes.rb
resources :project_associations, :only => [:update]
rake routes
project_association PUT /project_associations/:id(.:format) {:action=>"update", :controller=>"project_associations"}
ERB
<%= link_to membership_command[:text], project_association_path(membership_command[:id], :command => membership_command[:command])%>
Resulting HTML
<a href="/project_associations/2011?command=suspend">Suspend</a>
Click result: Routing Error No route matches "/project_associations/2011"
I kicked the server, same result
Thanks in advance for any assistance.
Upvotes: 3
Views: 149
Reputation: 4398
Add this to the link_to
: :method => :put
.
So:
<%= link_to membership_command[:text], project_association_path(membership_command[:id], :command => membership_command[:command]), :method => :put %>
Upvotes: 2