Although this is not a quick fix, it works:
At the end of each controller with a view, call the method to configure your repository for the current action in the session. If you use multiple controllers, create another variable for the controller.
eg.
def index ... # your stuff set_action("index") end protected def set_action(action_name) session[:action]=action_name
You can recreate the set_action method in each controller or create a helper, and then use 2 arguments:
def last_visited(action_name, controller_name) session[:action]=action_name session[:controller]=controller_name end
chech source share