class ApplicationController < ActionController::Base before_action :authenticate_user! rescue_from CanCan::AccessDenied do |exception| redirect_to root_url, notice: "You are not authorized to access this page." end end