Displaying 1 result from an estimated 1 matches for "still_logged_in".
2005 Dec 19
1
Application.rb / Application_Helper.rb / DRY help
Hi all,
I have defined the following method in both application.rb and
application_helper.rb:
def still_logged_in?
!session[:user_id].nil?
end
This method is called in a before_filter in my application.rb, as well
as in my layout/application.rhtml and view/user/login.rhtml (for
showing a login / logout button, etc.)
I had to put it both places, otherwise I would get an ''undefined method'...