hubfeenix.fi/app/controllers/application_controller.rb
2023-01-16 20:05:32 +02:00

14 lines
372 B
Ruby

class ApplicationController < ActionController::Base
include Pundit::Authorization
alias :current_user :current_member #for pundit
rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized
protected
def user_not_authorized
flash[:alert] = "You are not authorized to perform this action."
redirect_back(fallback_location: root_path)
end
end