Skip to content

Instantly share code, notes, and snippets.

@metalelf0
Created March 2, 2012 09:29
Show Gist options
  • Save metalelf0/1957179 to your computer and use it in GitHub Desktop.
Save metalelf0/1957179 to your computer and use it in GitHub Desktop.
class ApplicationController < ActionController::Base
protect_from_forgery
def current_ability
@current_ability ||= Spree::Ability.new(current_user)
end
rescue_from CanCan::AccessDenied do |exception|
redirect_to :root, :alert => exception.message
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment