Class: Bootstrap::ViewHelpers::Components::Accordion::Card

Inherits:
Card show all
Defined in:
lib/bootstrap/view_helpers/components/accordion/card.rb

Instance Attribute Summary

Attributes inherited from Bootstrap::ViewHelpers::Component

#block, #options, #style, #view

Instance Method Summary collapse

Methods inherited from Card

#footer, #to_html

Methods inherited from Bootstrap::ViewHelpers::Component

#initialize, #to_html

Constructor Details

This class inherits a constructor from Bootstrap::ViewHelpers::Component

Instance Method Details

#body(_ = nil, &_block) ⇒ Object



13
14
15
16
17
# File 'lib/bootstrap/view_helpers/components/accordion/card.rb', line 13

def body(_ = nil, &_block)
  (:div, collapse_options) do
    (:div, class: body_class(options)) { yield }
  end
end

#header(_ = nil, _ = {}) ⇒ Object



6
7
8
9
10
11
# File 'lib/bootstrap/view_helpers/components/accordion/card.rb', line 6

def header(_ = nil, _ = {})
  (:div, class: "card-header p-0 #{options[:class]}",
              id: header_id) do
    title_tag(options[:title])
  end
end