I'm wondering what the best practice is for passing referring actions
to a new action. For example if I have an action that I use a million
times in my application I want to be able to call it, and then be
returned to the action that called it... whatever it may be.
Currently I'm using parameters.... When I call the method with a
link_to for example, I do something like this in the view...
I'm wondering what the best practice is for passing referring actions
to a new action. For example if I have an action that I use a million
times in my application I want to be able to call it, and then be
returned to the action that called it... whatever it may be.
I guess I could pass these things to a session, is that the best way?
Thanks in advance guys!
People use session to store the url where you need to return to. You can retrieve it with request.request_uri
Well the ultimate goal is to be able to go back to the action I came
from once I'm finished in the "current" action.
Eg.
View an Order -> call action "edit item name" -> go back to view order
OR
view and ITEM -> call action "edit item name" -> go back to view ITEM
I want the action "edit item name" to be the same one for both calls,
so I need to save the action I was in prior to calling "edit item
name"...
I think putting a filter action in the aplication.rb file that runs
before each action calll to store the refering action / controller into
a session would be a good way of doing it.