When I just had resources :feedback in my routes.rb, I would use this link helper that would work fine:
<%= link_to 'Delete', feedback, :confirm => 'Are you sure?', :method => :destroy %>
But now, given that I have updated the route to be:
scope ":username" do
resources :feedbacks
end
I get this error:
ActionView::Template::Error (No route matches {:action=>"show", :controller=>"feedbacks", :username=>#<Feedback id: 1, poster_id: 1, receiver_id: 2, content: "Test 2 is awesome", created_at: "2011-09-10 23:00:32", updated_at: "2011-09-10 23:00:32">}):
How do I create a link to Delete/Destroy using the Rails helper method to this nested resource?
Thanks.
You can always run rake routes to see what the routing system generated, in your case:
<< there was wrong code snippet
UPD
So you helper somthing is:
and link_to