我正在尝试找到一种方法来在没有该redirect_to
方法的情况下在活动页面上显示我的 flash 错误。
顺便说一句,标准flash[:alert] = exception.message
没有向我显示任何错误消息,所以我将其更改为flash[:error]
.
感谢您的任何建议!
rescue_from CanCan::AccessDenied do |exception|
flash[:error] = exception.message
redirect_to deadlines_path
end