1
0
Fork 0

Catch cancan exception in application_controller

This commit is contained in:
Andrew Tomaka 2013-04-07 06:08:34 -04:00
parent 3df8156177
commit 57a3282ffb

View file

@ -1,3 +1,8 @@
class ApplicationController < ActionController::Base
protect_from_forgery
rescue_from CanCan::AccessDenied do |exception|
flash[:error] = "Access denied."
redirect_to root_url
end
end