Helper Class not Accessible from View

Putting include SessionsHelper in your controller includes those module methods in the controller, so they are accessible in your controller methods. You want the helper methods available in your views, so you need to use helper SessionsHelper in your application controller.

That being said, I do agree with Jits that the methods you have in SessionsHelper really do belong in the controller instead of in a helper.


Generally you should have methods like current_user defined in your application_controller and then make them available as helpers in the views. This way the controllers have access to them (and trust me, you will most likely need access to things like that). Example:

def current_user
  ..
end
helper :current_user