class ActiveAdmin::Views::Panel

Public Instance Methods

add_child(child) click to toggle source
Calls superclass method
# 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 = {}) click to toggle source
Calls superclass method
# 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) : "".html_safe
  super(attributes)
  add_class "panel"
  @title = h3(icn + title.to_s)
  @contents = div(class: "panel_contents")
end
children?() click to toggle source

Override children? to only report children when the panel’s contents have been added to. This ensures that the panel correcly appends string values, etc.

# File lib/active_admin/views/components/panel.rb, line 27
def children?
  @contents.children?
end