Using a restful resource in Rails, I would like to be able to insert a link into my flash hash that the user can click to destroy the object in question. The only problem seems to be that I cannot get the generated link to work with the RESTful controller!
First I tried
link_to "Change your reservation", reservation_path(@existing_reservation), :method => :delete
This didn't work because link_to is a helper method in ActionView, not available in controllers
Next find was url_for
url_for :controller => 'reservations', :actions => 'destroy', :method => :delete
which took me back to the show action. I have tried every combination of the two that I can find . . . but I can't seem to create a link in my controller that will slip in the delete method! Every action I generate produces a normal link (GET), which calls the show method.
Any ideas?