app/controllers/application_controller.rb
def admin_authenticated?
        unless is_admin?
            redirect_to :root
        end
    end
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception.
For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception . For APIs you may want to use : null_session instead .
def admin_authenticated?
        unless is_admin?
            redirect_to :root
        end
    end
def admin_authenticated? unless is_admin? redirect_to :root end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .