Class: ActiveAdmin::ResourceController

Inherits:
BaseController
  • Object
show all
Extended by:
ResourceClassMethods
Includes:
ActionBuilder, DataAccess, Decorators, Scoping, Sidebars, Streaming
Defined in:
lib/active_admin/resource_controller.rb,
lib/active_admin/resource_controller/scoping.rb,
lib/active_admin/resource_controller/sidebars.rb,
lib/active_admin/resource_controller/streaming.rb,
lib/active_admin/resource_controller/decorators.rb,
lib/active_admin/resource_controller/data_access.rb,
lib/active_admin/resource_controller/action_builder.rb,
lib/active_admin/resource_controller/resource_class_methods.rb

Overview

All Resources Controller inherits from this controller. It implements actions and helpers for resources.

Defined Under Namespace

Modules: ActionBuilder, DataAccess, Decorators, ResourceClassMethods, Scoping, Sidebars, Streaming

Constant Summary

Constant Summary

Constants included from BaseController::Authorization

BaseController::Authorization::ACTIONS_DICTIONARY

Class Method Summary collapse

Methods included from ResourceClassMethods

override_resource_class_methods!

Methods included from Sidebars

#skip_sidebar!, #skip_sidebar?

Methods included from Streaming

#index, #stream_csv, #stream_resource

Methods included from Scoping

#begin_of_association_chain, #method_for_association_chain

Methods included from DataAccess

#apply_authorization_scope, #apply_filtering, #apply_pagination, #apply_scoping, #apply_sorting, #build_new_resource, #build_resource, #clean_search_params, #collection, #collection_before_scope, #create_resource, #current_scope, #destroy_resource, #find_collection, #find_resource, #max_per_page, #per_page, #resource, #save_resource, #scoped_collection, #update_resource

Methods included from Decorators

#apply_collection_decorator, #apply_decorator, undecorate

Methods inherited from BaseController

actions, #only_render_implemented_actions

Methods included from BaseController::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 BaseController::Menu

#current_menu, #set_current_tab

Class Method Details

.active_admin_config=(config) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/active_admin/resource_controller.rb', line 27

def self.active_admin_config=(config)
  if @active_admin_config = config
    defaults resource_class: config.resource_class,
             route_prefix:   config.route_prefix,
             instance_name:  config.resource_name.singular
  end
end

.inherited(base) ⇒ Object

Inherited Resources uses the `self.inherited(base)` hook to add in `self.resource_class`. To override it, we need to install our resource_class method each time we're inherited from.



38
39
40
41
# File 'lib/active_admin/resource_controller.rb', line 38

def self.inherited(base)
  super(base)
  base.override_resource_class_methods!
end