Module: TabsHelper

Defined in:
app/helpers/tabs_helper.rb

Instance Method Summary collapse

Instance Method Details

#tab_button(content = nil, id:, value:) ⇒ Object



2
3
4
# File 'app/helpers/tabs_helper.rb', line 2

def tab_button(content = nil, id:, value:, **, &)
  tag.button(content, id:, class: "btn", role: "tab", aria: { controls: value }, data: { tabs_target: "button", action: "tabs#select", value: }, **, &)
end

#tab_panel(id, labelled_by:) ⇒ Object



6
7
8
# File 'app/helpers/tabs_helper.rb', line 6

def tab_panel(id, labelled_by:, **, &)
  tag.div(id:, role: "tabpanel", aria: { labelledby: labelled_by }, data: { tabs_target: "tab" }, **, &)
end