Lets say I have a message resource. Somewhere in the html I have:
<%= link_to("Delete", message, :title => 'Delete', :confirm => 'Are you sure?',
:method => :delete )%>
Right after I delete it, it redirects me to the page where it lists all the messages. Is there a way to redirect to a page that I specify after the deletion?
In the controller:
To redirect to the last url, use:
http://api.rubyonrails.org/classes/ActionController/Base.html#M000662
If you can learn how to read api docs well, they are extremely useful, once you get the hang of them.