app/controllers/application_controller.rb
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
#protect_from_forgery with: :exception
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 authenticate_admin_user!
    if user_signed_in?
      redirect_to '/' unless current_user.role && current_user.role.name == 'super_admin'
    end
  end
def authenticate_admin_user! if user_signed_in? redirect_to '/' unless current_user . role && current_user . role . name == 'super_admin' end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .