module ActiveAdmin
This is a common set of Formtastic
overrides needed to build a filter form that lets you select from a set of search methods for a given attribute.
Your class must declare available filters for this module to work. Those filters must be recognizable by Ransack. For example:
class NumericInput < ::Formtastic::Inputs::NumberInput include Base include Base::SearchMethodSelect filter :eq, :gt, :lt end
Constants
- Auth
Default
Authorization
permissions for Active Admin- DEFAULT_MENU
- VERSION
Attributes
Public Class Methods
A callback is triggered each time (after) Active Admin loads the configuration files. This is an opportunity to hook into Resources after they’ve been loaded.
The block takes the current instance of [ActiveAdmin::Application]
Example:
ActiveAdmin.after_load do |app| app.namespaces.each do |name, namespace| puts "Namespace: #{name} loaded!" end end
@param [Block] block A block to call each time (after) AA loads resources
# File lib/active_admin.rb, line 111 def after_load(&block) ActiveSupport::Notifications.subscribe ActiveAdmin::Application::AfterLoadEvent, &wrap_block_for_active_support_notifications(block) end
A callback is triggered each time (before) Active Admin loads the configuration files. In development mode, this will happen whenever the user changes files. In production it only happens on boot.
The block takes the current instance of [ActiveAdmin::Application]
Example:
ActiveAdmin.before_load do |app| # Do some stuff before AA loads end
@param [Block] block A block to call each time (before) AA loads resources
# File lib/active_admin.rb, line 93 def before_load(&block) ActiveSupport::Notifications.subscribe ActiveAdmin::Application::BeforeLoadEvent, &wrap_block_for_active_support_notifications(block) end
# File lib/active_admin.rb, line 63 def deprecator @deprecator ||= ActiveSupport::Deprecation.new("4.0", "active-admin") end
Gets called within the initializer
# File lib/active_admin.rb, line 68 def setup application.setup! yield(application) application.prepare! end
Private Class Methods
# File lib/active_admin.rb, line 117 def wrap_block_for_active_support_notifications block proc { |_name, _start, _finish, _id, payload| block.call payload[:active_admin_application] } end