Class: UI::MenubarSubContentComponent

Inherits:
ViewComponent::Base
  • Object
show all
Includes:
MenubarSubContentBehavior
Defined in:
app/view_components/ui/menubar_sub_content_component.rb

Overview

SubContentComponent - ViewComponent implementation

Container for submenu items.

Examples:

Basic usage

render UI::SubContentComponent.new do
  render UI::ItemComponent.new { "Email" }
  render UI::ItemComponent.new { "Message" }
end

Instance Method Summary collapse

Methods included from MenubarSubContentBehavior

#menubar_sub_content_classes, #menubar_sub_content_data_attributes, #menubar_sub_content_html_attributes

Constructor Details

#initialize(classes: "", **attributes) ⇒ MenubarSubContentComponent

Returns a new instance of MenubarSubContentComponent.



15
16
17
18
# File 'app/view_components/ui/menubar_sub_content_component.rb', line 15

def initialize(classes: "", **attributes)
  @classes = classes
  @attributes = attributes
end

Instance Method Details

#callObject



20
21
22
23
24
# File 'app/view_components/ui/menubar_sub_content_component.rb', line 20

def call
   :div, **menubar_sub_content_html_attributes.deep_merge(@attributes) do
    content
  end
end