Class: RailsAdmin::MainController

Inherits:
ApplicationController show all
Includes:
ActionView::Helpers::TextHelper, ApplicationHelper, MainHelper
Defined in:
app/controllers/rails_admin/main_controller.rb

Instance Attribute Summary

Attributes inherited from ApplicationController

#abstract_model, #authorization_adapter, #model_config, #object

Instance Method Summary collapse

Methods included from ApplicationHelper

#action, #actions, #authorized?, #breadcrumb, #bulk_menu, #capitalize_first_letter, #current_action?, #edit_user_link, #flash_alert_class, #logout_method, #logout_path, #main_navigation, #menu_for, #navigation, #root_navigation, #static_navigation, #wording_for

Methods included from Support::I18n

#abbr_day_names, #abbr_month_names, #date_format, #day_names, #month_names

Methods included from MainHelper

#filterable_fields, #get_column_sets, #get_indicator, #ordered_filter_options, #ordered_filters, #rails_admin_form_for

Methods inherited from ApplicationController

#_current_user, #get_model, #get_object, #to_model_name

Instance Method Details

#bulk_actionObject



27
28
29
# File 'app/controllers/rails_admin/main_controller.rb', line 27

def bulk_action
  send(params[:bulk_action]) if params[:bulk_action].in?(RailsAdmin::Config::Actions.all(controller: self, abstract_model: @abstract_model).select(&:bulkable?).collect(&:route_fragment))
end

#list_entries(model_config = @model_config, auth_scope_key = :index, additional_scope = get_association_scope_from_params, pagination = !(params[:associated_collection] || params[:all] || params[:bulk_ids]))) ⇒ Object



31
32
33
34
35
36
37
38
# File 'app/controllers/rails_admin/main_controller.rb', line 31

def list_entries(model_config = @model_config, auth_scope_key = :index, additional_scope = get_association_scope_from_params, pagination = !(params[:associated_collection] || params[:all] || params[:bulk_ids]))
  scope = model_config.abstract_model.scoped
  if auth_scope = @authorization_adapter && @authorization_adapter.query(auth_scope_key, model_config.abstract_model)
    scope = scope.merge(auth_scope)
  end
  scope = scope.instance_eval(&additional_scope) if additional_scope
  get_collection(model_config, scope, pagination)
end