Method: Bootstrap4Helper::Accordion#body
- Defined in:
- lib/bootstrap4_helper/accordion.rb
#body(opts = {}, &block) ⇒ String
Note:
The ‘@parent` gets used to set the parent element for the accordion. This gets used primarily in the `AccordionGroup`.
Builds the body component for the accordion, which is actually the body of a Card.
64 65 66 67 68 69 70 71 72 |
# File 'lib/bootstrap4_helper/accordion.rb', line 64 def body(opts = {}, &block) data = { parent: "##{@parent}" } if @parent.present? klass = 'collapse' klass += ' show' if @expanded content_tag :div, id: @target, class: klass, data: data do @card.body(opts, &block) end end |