class ActiveAdmin::Views::Panel
Public Instance Methods
Source
# File lib/active_admin/views/components/panel.rb, line 15 def add_child(child) if @contents @contents << child else super end end
Calls superclass method
Source
# File lib/active_admin/views/components/panel.rb, line 8 def build(title, attributes = {}) super(attributes) add_class "panel" @title = h3(title.to_s) @contents = div(class: "panel_contents") end
Calls superclass method
Source
# File lib/active_admin/views/components/panel.rb, line 26 def children? @contents.children? end
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.
Source
# File lib/active_admin/views/components/panel.rb, line 30 def header_action(*args) action = args[0] @title << div(class: "header_action") do action end end