Class: UI::ContextMenuTriggerComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::ContextMenuTriggerComponent
- Includes:
- ContextMenuTriggerBehavior
- Defined in:
- app/view_components/ui/context_menu_trigger_component.rb
Overview
TriggerComponent - ViewComponent implementation
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(classes: "", **attributes) ⇒ ContextMenuTriggerComponent
constructor
A new instance of ContextMenuTriggerComponent.
Methods included from ContextMenuTriggerBehavior
#context_menu_trigger_classes, #context_menu_trigger_data_attributes, #context_menu_trigger_html_attributes
Constructor Details
#initialize(classes: "", **attributes) ⇒ ContextMenuTriggerComponent
Returns a new instance of ContextMenuTriggerComponent.
7 8 9 10 |
# File 'app/view_components/ui/context_menu_trigger_component.rb', line 7 def initialize(classes: "", **attributes) @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'app/view_components/ui/context_menu_trigger_component.rb', line 12 def call attrs = attrs[:data] = attrs[:data].merge(@attributes.fetch(:data, {})) content_tag :div, **attrs.merge(@attributes.except(:data)) do content end end |