Class: ActiveAdmin::Views::Panel
- Defined in:
- lib/active_admin/views/components/panel.rb
Instance Method Summary collapse
- #add_child(child) ⇒ Object
- #build(title, attributes = {}) ⇒ Object
-
#children? ⇒ Boolean
Override children? to only report children when the panel’s contents have been added to.
Instance Method Details
#add_child(child) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/active_admin/views/components/panel.rb', line 15 def add_child(child) if @contents @contents << child else super end end |
#build(title, attributes = {}) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/active_admin/views/components/panel.rb', line 8 def build(title, attributes = {}) super(attributes) add_class "panel" @title = h3(title.to_s, class: "panel-title") @contents = div(class: "panel-body") end |
#children? ⇒ Boolean
Override children? to only report children when the panel’s contents have been added to. This ensures that the panel correctly appends string values, etc.
26 27 28 |
# File 'lib/active_admin/views/components/panel.rb', line 26 def children? @contents.children? end |