obdev/app/controllers/application_controller.rb

7 lines
211 B
Ruby

class ApplicationController < ActionController::Base
before_action :authenticate_user!
rescue_from CanCan::AccessDenied do |exception|
redirect_to root_url, alert: "Access denied."
end
end