You have written your code in application controller instead of application helper That is the reason why your method is not getting called
if you want to check if current user is logged in or not you may just use before filter in application controller and call the method
whenever you dont need to check the method add skip before filter in that place