I’m doing an app with session management and I want to display if the user is logged in or not at the top of every page. I have the front-end for this in application.rhtml.erb, is there any controller/method that will let me set a site-wide variable? As it is I define the condition for every individual page, there has to be a better way.
Share
Put your method in the
application_helper.rbfile. That’ll be available site-wide.