Sha256: 3565ff41cd8d99f468c71244af5d6dc8d5278c0a05f11394493e33122c0b4983
Contents?: true
Size: 1003 Bytes
Versions: 12
Compression:
Stored size: 1003 Bytes
Contents
# frozen_string_literal: true module EacRailsBase0 class ApplicationController < ActionController::Base include ::CanCanDry::ControllerAuthorization layout 'eac_rails_base0/application' helper ::EacRailsBase0::LinksHelper helper ::EacRailsBase0::LayoutHelper # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception before_action :authorize_by_ability_mapping rescue_from CanCan::AccessDenied do |exception| if current_user flash[:error] = "Conteúdo indisponível: #{exception}" redirect_to main_app.root_url else flash[:danger] = 'Por favor faça o login.' redirect_to eac_users_support.new_user_session_path end end class << self def active_scaffold_controller_for(klass) return ::EacUsersSupport::Admin::UsersController if klass == ::EacUsersSupport::User super end end end end
Version data entries
12 entries across 12 versions & 1 rubygems