Module: Components::DropdownMenuHelper

Defined in:
app/helpers/components/dropdown_menu_helper.rb

Instance Method Summary collapse

Instance Method Details



15
16
17
# File 'app/helpers/components/dropdown_menu_helper.rb', line 15

def dropdown_menu_content(&block)
  content_for :dropdown_menu_content, capture(&block), flush: true
end


19
20
21
22
# File 'app/helpers/components/dropdown_menu_helper.rb', line 19

def dropdown_menu_item(label = nil, **options, &block)
  content = (label || capture(&block))
  render "components/ui/shared/menu_item", content: content
end


11
12
13
# File 'app/helpers/components/dropdown_menu_helper.rb', line 11

def dropdown_menu_label(label = nil, &block)
  content_for :dropdown_menu_label, (label || capture(&block)), flush: true
end


7
8
9
# File 'app/helpers/components/dropdown_menu_helper.rb', line 7

def dropdown_menu_trigger(&block)
  content_for :dropdown_menu_trigger, capture(&block), flush: true
end

#render_dropdown_menu(**options, &block) ⇒ Object



2
3
4
5
# File 'app/helpers/components/dropdown_menu_helper.rb', line 2

def render_dropdown_menu(**options, &block)
  content = capture(&block) if block
  render "components/ui/dropdown_menu", content: content, **options
end