Module: ActiveAdmin

Defined in:
lib/active_admin/inputs/filters/base/search_method_select.rb,
lib/active_admin.rb,
lib/active_admin/dsl.rb,
lib/active_admin/menu.rb,
lib/active_admin/page.rb,
lib/active_admin/error.rb,
lib/active_admin/scope.rb,
lib/active_admin/views.rb,
lib/active_admin/devise.rb,
lib/active_admin/engine.rb,
lib/active_admin/inputs.rb,
lib/active_admin/router.rb,
lib/active_admin/version.rb,
lib/active_admin/page_dsl.rb,
lib/active_admin/resource.rb,
lib/active_admin/callbacks.rb,
lib/active_admin/component.rb,
lib/active_admin/menu_item.rb,
lib/active_admin/namespace.rb,
lib/active_admin/dependency.rb,
lib/active_admin/localizers.rb,
lib/active_admin/application.rb,
lib/active_admin/csv_builder.rb,
lib/active_admin/deprecation.rb,
lib/active_admin/filters/dsl.rb,
lib/active_admin/form_builder.rb,
lib/active_admin/helpers/i18n.rb,
lib/active_admin/order_clause.rb,
lib/active_admin/resource_dsl.rb,
lib/active_admin/view_factory.rb,
lib/active_admin/view_helpers.rb,
lib/active_admin/views/footer.rb,
lib/active_admin/views/header.rb,
lib/active_admin/filters/forms.rb,
lib/active_admin/resource/menu.rb,
lib/active_admin/settings_node.rb,
lib/active_admin/cancan_adapter.rb,
lib/active_admin/filters/active.rb,
lib/active_admin/page_presenter.rb,
lib/active_admin/pundit_adapter.rb,
lib/active_admin/resource/model.rb,
lib/active_admin/base_controller.rb,
lib/active_admin/dynamic_setting.rb,
lib/active_admin/menu_collection.rb,
lib/active_admin/page_controller.rb,
lib/active_admin/resource/naming.rb,
lib/active_admin/resource/routes.rb,
lib/active_admin/resource/scopes.rb,
lib/active_admin/sidebar_section.rb,
lib/active_admin/views/title_bar.rb,
lib/active_admin/views/pages/base.rb,
lib/active_admin/views/pages/form.rb,
lib/active_admin/views/pages/page.rb,
lib/active_admin/views/pages/show.rb,
lib/active_admin/controller_action.rb,
lib/active_admin/resource/includes.rb,
lib/active_admin/resource/ordering.rb,
lib/active_admin/resource/scope_to.rb,
lib/active_admin/resource/sidebars.rb,
lib/active_admin/views/pages/index.rb,
lib/active_admin/asset_registration.rb,
lib/active_admin/helpers/collection.rb,
lib/active_admin/namespace_settings.rb,
lib/active_admin/views/action_items.rb,
lib/active_admin/views/pages/layout.rb,
lib/active_admin/helpers/scope_chain.rb,
lib/active_admin/inputs/filters/base.rb,
lib/active_admin/resource/attributes.rb,
lib/active_admin/resource/belongs_to.rb,
lib/active_admin/resource/pagination.rb,
lib/active_admin/resource_collection.rb,
lib/active_admin/resource_controller.rb,
lib/active_admin/views/index_as_blog.rb,
lib/active_admin/views/index_as_grid.rb,
lib/active_admin/application_settings.rb,
lib/active_admin/base_controller/menu.rb,
lib/active_admin/collection_decorator.rb,
lib/active_admin/resource/controllers.rb,
lib/active_admin/views/index_as_block.rb,
lib/active_admin/views/index_as_table.rb,
lib/active_admin/abstract_view_factory.rb,
lib/active_admin/authorization_adapter.rb,
lib/active_admin/dynamic_settings_node.rb,
lib/active_admin/filters/active_filter.rb,
lib/active_admin/resource/action_items.rb,
lib/active_admin/views/components/menu.rb,
lib/active_admin/views/components/tabs.rb,
lib/active_admin/filters/active_sidebar.rb,
lib/active_admin/generators/boilerplate.rb,
lib/active_admin/views/components/panel.rb,
lib/active_admin/inputs/datepicker_input.rb,
lib/active_admin/view_helpers/fields_for.rb,
lib/active_admin/views/components/scopes.rb,
lib/active_admin/views/tabbed_navigation.rb,
lib/active_admin/batch_actions/controller.rb,
lib/active_admin/helpers/optional_display.rb,
lib/active_admin/resource/page_presenters.rb,
lib/active_admin/view_helpers/form_helper.rb,
lib/active_admin/views/components/columns.rb,
lib/active_admin/views/components/sidebar.rb,
lib/active_admin/filters/formtastic_addons.rb,
lib/active_admin/inputs/filters/text_input.rb,
lib/active_admin/view_helpers/flash_helper.rb,
lib/active_admin/view_helpers/title_helper.rb,
lib/active_admin/filters/resource_extension.rb,
lib/active_admin/helpers/routes/url_helpers.rb,
lib/active_admin/views/components/menu_item.rb,
lib/active_admin/views/components/table_for.rb,
lib/active_admin/inputs/filters/select_input.rb,
lib/active_admin/inputs/filters/string_input.rb,
lib/active_admin/resource_controller/scoping.rb,
lib/active_admin/view_helpers/display_helper.rb,
lib/active_admin/view_helpers/sidebar_helper.rb,
lib/active_admin/views/components/index_list.rb,
lib/active_admin/views/components/site_title.rb,
lib/active_admin/views/components/status_tag.rb,
lib/active_admin/inputs/filters/boolean_input.rb,
lib/active_admin/inputs/filters/numeric_input.rb,
lib/active_admin/resource_controller/sidebars.rb,
lib/active_admin/views/components/blank_slate.rb,
lib/active_admin/base_controller/authorization.rb,
lib/active_admin/localizers/resource_localizer.rb,
lib/active_admin/resource_controller/streaming.rb,
lib/active_admin/view_helpers/auto_link_helper.rb,
lib/active_admin/resource_controller/decorators.rb,
lib/active_admin/view_helpers/breadcrumb_helper.rb,
lib/active_admin/view_helpers/scope_name_helper.rb,
lib/active_admin/views/components/dropdown_menu.rb,
lib/generators/active_admin/page/page_generator.rb,
lib/active_admin/inputs/filters/date_range_input.rb,
lib/active_admin/resource_controller/data_access.rb,
lib/active_admin/batch_actions/resource_extension.rb,
lib/active_admin/inputs/filters/check_boxes_input.rb,
lib/active_admin/inputs/filters/date_picker_input.rb,
lib/active_admin/view_helpers/view_factory_helper.rb,
lib/active_admin/views/components/sidebar_section.rb,
lib/active_admin/views/components/attributes_table.rb,
lib/active_admin/orm/active_record/comments/comment.rb,
lib/active_admin/resource_controller/action_builder.rb,
lib/active_admin/views/components/active_admin_form.rb,
lib/generators/active_admin/assets/assets_generator.rb,
lib/generators/active_admin/devise/devise_generator.rb,
lib/active_admin/batch_actions/views/selection_cells.rb,
lib/active_admin/views/components/unsupported_browser.rb,
lib/generators/active_admin/install/install_generator.rb,
lib/active_admin/batch_actions/views/batch_action_form.rb,
lib/active_admin/views/components/paginated_collection.rb,
lib/active_admin/resource_controller/polymorphic_routes.rb,
lib/generators/active_admin/resource/resource_generator.rb,
lib/generators/active_admin/webpacker/webpacker_generator.rb,
lib/active_admin/batch_actions/views/batch_action_selector.rb,
lib/active_admin/view_helpers/download_format_links_helper.rb,
lib/active_admin/orm/active_record/comments/resource_helper.rb,
lib/active_admin/resource_controller/resource_class_methods.rb,
lib/active_admin/orm/active_record/comments/namespace_helper.rb,
lib/active_admin/orm/active_record/comments/show_page_helper.rb,
lib/active_admin/view_helpers/active_admin_application_helper.rb,
lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb

Overview

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 :equals, :greater_than, :less_than
end

Defined Under Namespace

Modules: AssetRegistration, Authorization, BatchActions, Callbacks, Comments, Dependency, Deprecation, Devise, Filters, Generators, Helpers, Inputs, Localizers, OptionalDisplay, ScopeChain, ViewHelpers, Views Classes: AbstractViewFactory, AccessDenied, ActionItem, Application, ApplicationSettings, AuthorizationAdapter, BaseController, BatchAction, CSVBuilder, CanCanAdapter, CollectionDecorator, Comment, Component, ControllerAction, DSL, DatabaseHitDuringLoad, DependencyError, DynamicSetting, DynamicSettingsNode, Engine, Error, ErrorLoading, FormBuilder, GeneratorError, HasManyBuilder, Menu, MenuCollection, MenuItem, Model, Namespace, NamespaceSettings, NoMenuError, OrderClause, Page, PageController, PageDSL, PagePresenter, PunditAdapter, Resource, ResourceCollection, ResourceController, ResourceDSL, Scope, SettingsNode, SidebarSection, StringSymbolOrProcSetting, ViewFactory

Constant Summary collapse

VERSION =
'2.7.0'
DEFAULT_MENU =
:default
Auth =
Authorization

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.applicationObject

Returns the value of attribute application


59
60
61
# File 'lib/active_admin.rb', line 59

def application
  @application
end

Class Method Details

.after_load(&block) ⇒ Object

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

Parameters:

  • block (Block)

    A block to call each time (after) AA loads resources


109
110
111
# File 'lib/active_admin.rb', line 109

def after_load(&block)
  ActiveSupport::Notifications.subscribe ActiveAdmin::Application::AfterLoadEvent, &wrap_block_for_active_support_notifications(block)
end

.before_load(&block) ⇒ Object

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

Parameters:

  • block (Block)

    A block to call each time (before) AA loads resources


91
92
93
# File 'lib/active_admin.rb', line 91

def before_load(&block)
  ActiveSupport::Notifications.subscribe ActiveAdmin::Application::BeforeLoadEvent, &wrap_block_for_active_support_notifications(block)
end

.setup {|application| ... } ⇒ Object

Gets called within the initializer

Yields:


66
67
68
69
70
# File 'lib/active_admin.rb', line 66

def setup
  application.setup!
  yield(application)
  application.prepare!
end