Skip to content

Instantly share code, notes, and snippets.

@gavingmiller
Created September 19, 2013 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gavingmiller/6627630 to your computer and use it in GitHub Desktop.
Save gavingmiller/6627630 to your computer and use it in GitHub Desktop.
class BaseController < ApplicationController
# Access Errors (401, 402)
rescue_from CanCan::AccessDenied do |exception|
if current_ability.payment_required?(exception)
general_error(exception.message, 402)
else
general_error(exception.message, 401)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment