Module: Trestle::CardHelper

Defined in:
app/helpers/trestle/card_helper.rb

Instance Method Summary collapse

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(options={}, &block)
  (:div, options.slice(:id, :data).merge(class: ["card", options[:class]].compact)) do
    safe_join([
      ((:div, options[:header], class: "card-header") if options[:header]),
      (:div, class: "card-body", &block),
      ((:div, options[:footer], class: "card-footer") if options[:footer])
    ].compact)
  end
end

#panel(options = {}, &block) ⇒ Object



13
14
15
16
# File 'app/helpers/trestle/card_helper.rb', line 13

def panel(options={}, &block)
  ActiveSupport::Deprecation.warn("The panel helper is deprecated and will be removed in future versions of Trestle. Please use the card helper instead.")
  card(options.merge(header: options[:title]), &block)
end

#well(options = {}, &block) ⇒ Object



18
19
20
21
# File 'app/helpers/trestle/card_helper.rb', line 18

def well(options={}, &block)
  ActiveSupport::Deprecation.warn("The well helper is deprecated and will be removed in future versions of Trestle. Please use the card helper instead.")
  card(options, &block)
end