CanCanCan rescue_from没有捕获

时间:2016-09-01 04:01:43

标签: ruby-on-rails cancan ruby-on-rails-5 cancancan

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

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

我在ApplicationController中有这个,它仍然没有捕获CanCan::AccessDenied in RailsAdmin::MainController#dashboard

0 个答案:

没有答案