Sha256: 4dae4a6b427431229a8cb67631d6b4902d6b06f1b2e453baae73153fd55a8738
Contents?: true
Size: 720 Bytes
Versions: 5
Compression:
Stored size: 720 Bytes
Contents
# frozen_string_literal: true module ActiveAdmin module Views class Panel < ActiveAdmin::Component builder_method :panel def build(title, attributes = {}) super(attributes) add_class "panel" @title = h3(title.to_s, class: "panel-title") @contents = div(class: "panel-body") end def add_child(child) if @contents @contents << child else super end 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. def children? @contents.children? end end end end
Version data entries
5 entries across 5 versions & 1 rubygems