CanCanCan rescue_from do not catch

class ApplicationController < ActionController::Base
  protect_from_forgery with: :exception

  rescue_from CanCan::AccessDenied do |exception|
    redirect_to root_url, :alert => exception.message
  end
end

I have this inside my ApplicationController and it still doesn't catch CanCan::AccessDenied in RailsAdmin::MainController#dashboard

+4
source share

Source: https://habr.com/ru/post/1653241/


All Articles