Class: ActiveAdmin::Views::Pages::Index

Inherits:
Base
  • Object
show all
Includes:
Helpers::Collection, ActiveAdmin::ViewHelpers::DownloadFormatLinksHelper
Defined in:
lib/active_admin/views/pages/index.rb

Instance Method Summary collapse

Methods included from Helpers::Collection

#collection_is_empty?, #collection_size

Methods inherited from Base

#build, #html_title

Instance Method Details

#configObject

Retrieves the given page presenter, or uses the default.



19
20
21
22
# File 'lib/active_admin/views/pages/index.rb', line 19

def config
  active_admin_config.get_page_presenter(:index, params[:as]) ||
  ActiveAdmin::PagePresenter.new(as: :table)
end

#main_contentObject

Renders the index configuration that was set in the controller. Defaults to rendering the ActiveAdmin::Pages::Index::Table



26
27
28
29
30
31
# File 'lib/active_admin/views/pages/index.rb', line 26

def main_content
  wrap_with_batch_action_form do
    build_table_tools
    build_collection
  end
end

#titleObject



10
11
12
13
14
15
16
# File 'lib/active_admin/views/pages/index.rb', line 10

def title
  if Proc === config[:title]
    controller.instance_exec &config[:title]
  else
    config[:title] || assigns[:page_title] || active_admin_config.plural_resource_label
  end
end