Method: Bootstrap4Helper::Accordion#header

Defined in:
lib/bootstrap4_helper/accordion.rb

#header(opts = {}, &block) ⇒ String

Builds a header component for the accordion, which is actually the header of a Card.

Parameters:

  • opts (Hash) (defaults to: {})

Returns:

  • (String)


43
44
45
46
47
48
49
50
51
52
53
# File 'lib/bootstrap4_helper/accordion.rb', line 43

def header(opts = {}, &block)
  @card.header(opts) do
    (config(:accordion_header, :h5)) do
      (
        :a,
        data: { toggle: 'collapse', target: "##{@target}" },
        &block
      )
    end
  end
end