Class: ActiveAdmin::Views::AttributesPanel

Inherits:
Component
  • Object
show all
Defined in:
lib/active_admin/views/components/attributes_panel.rb

Instance Method Summary collapse

Instance Method Details

#build(*args, &block) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/active_admin/views/components/attributes_panel.rb', line 8

def build(*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
  resource_columns = args.present? ? args : active_admin_config.resource_columns
  panel(table_title) do
    attributes_table_for(resource, *resource_columns, &block)
    active_admin_comments_for(resource) if active_admin_config.comments?
  end
end