app/controllers/application_controller.rb
# 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 ensure_current_user_is_superadmin!
    authenticate_user!
    unless current_user.super_admin?
      redirect_to root_path, status: :forbidden, alert: "Unauthorized Access!"
    end
  end
def ensure_current_user_is_superadmin! authenticate_user! unless current_user . super_admin? redirect_to root_path , status : :forbidden , alert : "Unauthorized Access!" end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .