From 6d6cd2be1462d5b37f792317d2bae4f9a247f8a9 Mon Sep 17 00:00:00 2001 From: Mike Kelley Date: Sat, 27 Aug 2011 03:03:54 -0600 Subject: [PATCH] added rescue functionality for cancan --- app/controllers/application_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e8065d9..0077313 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,3 +1,7 @@ class ApplicationController < ActionController::Base protect_from_forgery + + rescue_from CanCan::AccessDenied do |exception| + redirect_to root_url, :alert => "You don't have access to that feature. Please try again." + end end