Rescue From With A Separate Method
class ApplicationController < ActionController::Base
rescue_from User::NotAuthorized, with: :handle_unauthorized_user
def index
# ...
end
private
def handle_unauthorized_user(exception)
# respond with some Not Authorized page
end
endLast updated