Class: ActiveAdmin::Views::Panel

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

Instance Method Summary collapse

Methods inherited from Component

#default_class_name, #initialize, #tag_name

Constructor Details

This class inherits a constructor from ActiveAdmin::Component

Instance Method Details

#add_child(child) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/active_admin/views/components/panel.rb', line 16

def add_child(child)
  if @contents
    @contents << child
  else
    super
  end
end

#build(title, attributes = {}) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/active_admin/views/components/panel.rb', line 7

def build(title, attributes = {})
  icon_name = attributes.delete(:icon)
  icn = icon_name ? icon(icon_name) : ""
  super(attributes)
  add_class "panel"
  @title = h3(icn + title.to_s)
  @contents = div(:class => "panel_contents")
end