Module: Trestle::CardHelper
- Defined in:
- app/helpers/trestle/card_helper.rb
Instance Method Summary collapse
- #card(options = {}, &block) ⇒ Object
- #panel(options = {}, &block) ⇒ Object
- #well(options = {}, &block) ⇒ Object
Instance Method Details
#card(options = {}, &block) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'app/helpers/trestle/card_helper.rb', line 3 def card(={}, &block) content_tag(:div, .slice(:id, :data).merge(class: ["card", [:class]].compact)) do safe_join([ (content_tag(:div, [:header], class: "card-header") if [:header]), content_tag(:div, class: "card-body", &block), (content_tag(:div, [:footer], class: "card-footer") if [:footer]) ].compact) end end |
#panel(options = {}, &block) ⇒ Object
13 14 15 16 |
# File 'app/helpers/trestle/card_helper.rb', line 13 def panel(={}, &block) Trestle.deprecator.warn("The panel helper is deprecated and will be removed in future versions of Trestle. Please use the card helper instead.") card(.merge(header: [:title]), &block) end |
#well(options = {}, &block) ⇒ Object
18 19 20 21 |
# File 'app/helpers/trestle/card_helper.rb', line 18 def well(={}, &block) Trestle.deprecator.warn("The well helper is deprecated and will be removed in future versions of Trestle. Please use the card helper instead.") card(, &block) end |