def is_admin?
@current_user && @current_user.admin == 1
end
I want to be able to call this method from all my controllers and all my
views.
If I put this method in application_controller I can call it from all my
controllers but none of my views.
If I put this method in application_helper I can call it from all my
views but none of my controllers.
def is_admin?
@current_user && @current_user.admin == 1
end
I want to be able to call this method from all my controllers and
all my
views.
If I put this method in application_controller I can call it from
all my
controllers but none of my views.
If I put this method in application_helper I can call it from all my
views but none of my controllers.
Put it in application.rb & then use helper_method ?