rest - Is there a way to redirect to a specific page after a RESTful delete in Rails? -
Let's say I have a message resource where I have somewhere in the HTML:
Lt;% = link_to ("Delete", Message,: Title = & gt; 'Delete' ,: Confirmation = & gt; 'Are you sure?',: Method = & gt ;: delete)% & gt;
Immediately after removing it, it redirects to the page where it lists all the messages, is there a way to redirect to that page that I deleted Specify?
In the Controller:
Remove from def items. (Param [: ID]). Redirect_to: action = & gt; Use the "index" and
to redirect to the last URL:
redirect_to: back
< / P>
If you can read API docs, they are very useful, once you hang them.
Comments
Post a Comment