Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Filters added to this controller apply to all controllers in the application.
- # Likewise, all the methods added will be available for all controllers.
- class ApplicationController < ActionController::Base
- helper :all
- helper_method :set_menu_to, :back_path_or
- before_filter :store_location
- private
- def set_menu_to(menu)
- @menu = menu
- end
- def store_location
- if request.request_method == :get && session[:last] != request.request_uri
- session[:back_path] = session[:last]
- session[:last] = request.request_uri
- end
- end
- def back_path_or(default)
- session[:back_path] || default
- end
- end
Add Comment
Please, Sign In to add comment