app/controllers/application_controller.rb
def require_admin
    if require_log_in
      if is_admin_user
        return true
      else
        redirect_to user_path current_user
      end
    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 require_admin
    if require_log_in
      if is_admin_user
        return true
      else
        redirect_to user_path current_user
      end
    end
  end
def require_admin if require_log_in if is_admin_user return true else redirect_to user_path current_user end end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .