Class: ActiveAdmin::BaseController

Inherits:
InheritedResources::Base
  • Object
show all
Includes:
Authorization, Menu
Defined in:
lib/active_admin/base_controller.rb,
lib/active_admin/base_controller/menu.rb,
lib/active_admin/base_controller/authorization.rb

Overview

BaseController for ActiveAdmin. It implements ActiveAdmin controllers core features.

Direct Known Subclasses

PageController, ResourceController

Defined Under Namespace

Modules: Authorization, Menu

Constant Summary

Constant Summary

Constants included from Authorization

Authorization::ACTIONS_DICTIONARY

Class Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods included from Authorization

#action_to_permission, #active_admin_authorization, #active_admin_authorization_adapter, #authorize!, #authorize_resource!, #authorized?, #dispatch_active_admin_access_denied, #redirect_backwards_or_to_root, #rescue_active_admin_access_denied

Methods included from MethodOrProcHelper

#call_method_or_exec_proc, #call_method_or_proc_on, #render_in_context, #render_or_call_method_or_proc_on

Methods included from Menu

#current_menu, #set_current_tab

Class Attribute Details

+ (Object) active_admin_config

Reference to the Resource object which initialized this controller



23
24
25
# File 'lib/active_admin/base_controller.rb', line 23

def active_admin_config
  @active_admin_config
end

Class Method Details

+ (Object) actions

Instance Method Details

- (Object) only_render_implemented_actions

By default Rails will render un-implemented actions when the view exists. Because Active Admin allows you to not render any of the actions by using the #actions method, we need to check if they are implemented.

Raises:

  • (AbstractController::ActionNotFound)


29
30
31
# File 'lib/active_admin/base_controller.rb', line 29

def only_render_implemented_actions
  raise AbstractController::ActionNotFound unless action_methods.include?(params[:action])
end