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, #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, #logout_method, #logout_path, #main_navigation, #menu_for, #navigation, #static_navigation, #wording_for

Methods included from I18nSupport

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

Methods included from MainHelper

#get_column_sets, #get_indicator, #rails_admin_form_for

Methods inherited from ApplicationController

#_current_user, #get_model, #get_object, #to_model_name

Instance Method Details

#bulk_actionObject


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

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


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

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