Module: Components::DropdownMenuHelper
- Defined in:
- app/helpers/components/dropdown_menu_helper.rb
Instance Method Summary collapse
- #dropdown_menu_content(&block) ⇒ Object
- #dropdown_menu_item(label = nil, **options, &block) ⇒ Object
- #dropdown_menu_label(label = nil, &block) ⇒ Object
- #dropdown_menu_trigger(&block) ⇒ Object
- #render_dropdown_menu(**options, &block) ⇒ Object
Instance Method Details
#dropdown_menu_content(&block) ⇒ Object
15 16 17 |
# File 'app/helpers/components/dropdown_menu_helper.rb', line 15 def (&block) content_for :dropdown_menu_content, capture(&block), flush: true end |
#dropdown_menu_item(label = nil, **options, &block) ⇒ Object
19 20 21 22 |
# File 'app/helpers/components/dropdown_menu_helper.rb', line 19 def (label = nil, **, &block) content = (label || capture(&block)) render "components/ui/shared/menu_item", content: content end |
#dropdown_menu_label(label = nil, &block) ⇒ Object
11 12 13 |
# File 'app/helpers/components/dropdown_menu_helper.rb', line 11 def (label = nil, &block) content_for :dropdown_menu_label, (label || capture(&block)), flush: true end |
#dropdown_menu_trigger(&block) ⇒ Object
7 8 9 |
# File 'app/helpers/components/dropdown_menu_helper.rb', line 7 def (&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 (**, &block) content = capture(&block) if block render "components/ui/dropdown_menu", content: content, ** end |