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, #current_action?, #edit_user_link, #main_navigation, #menu_for, #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

#get_model, #get_object, #to_model_name

Instance Method Details

#bulk_actionObject



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

def bulk_action
  self.send(params[:bulk_action]) if params[:bulk_action].in?(RailsAdmin::Config::Actions.all(:controller => self, :abstract_model => @abstract_model).select(&:bulkable?).map(&: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]))) ⇒ Object



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

def list_entries(model_config = @model_config, auth_scope_key = :index, additional_scope = get_association_scope_from_params, pagination = !(params[:associated_collection] || params[:all]))
  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