Class: ActiveAdmin::Views::Pages::Show

Inherits:
Base
  • Object
show all
Includes:
DefaultMainContent
Defined in:
lib/active_admin/views/pages/show.rb

Defined Under Namespace

Modules: DefaultMainContent

Instance Method Summary collapse

Methods included from DefaultMainContent

#default_attribute_table_rows, #default_main_content

Methods inherited from Base

#build, #html_title

Instance Method Details

#attributes_table(*args, &block) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/active_admin/views/pages/show.rb', line 28

def attributes_table(*args, &block)
  opts = args.extract_options!
  table_title = if opts.has_key?(:title)
                  render_or_call_method_or_proc_on(resource, opts[:title])
                else
                  ActiveAdmin::Localizers.resource(active_admin_config).t(:details)
                end
  panel(table_title) do
    attributes_table_for resource, *args, &block
  end
end

#configObject



7
8
9
# File 'lib/active_admin/views/pages/show.rb', line 7

def config
  active_admin_config.get_page_presenter(:show) || super
end

#default_titleObject (protected)



42
43
44
# File 'lib/active_admin/views/pages/show.rb', line 42

def default_title
  display_name(resource)
end

#main_contentObject



19
20
21
22
23
24
25
26
# File 'lib/active_admin/views/pages/show.rb', line 19

def main_content
  if config.block
    # Eval the show config from the controller
    instance_exec resource, &config.block
  else
    default_main_content
  end
end

#titleObject



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

def title
  if config[:title]
    render_or_call_method_or_proc_on(resource, config[:title])
  else
    assigns[:page_title] || default_title
  end
end