ruby on rails - How to "inherit" a class variable from ApplicationController -
i'm little new rails.
say want like:
def is_admin? @admin = user.grab(session[:username]).admin end
i can define in applicationcontroller have call is_admin?()
in every method in every subsequent controller. there way around not aware of?
use :before_filter
@ start of each controller:
before_filter :is_admin
at least don't have every method.
Comments
Post a Comment