Class: UI::PopoverContentComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::PopoverContentComponent
- Includes:
- PopoverContentBehavior
- Defined in:
- app/view_components/ui/popover_content_component.rb
Overview
ContentComponent - ViewComponent implementation
The floating content panel. Uses PopoverContentBehavior concern for shared styling logic.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(side: "bottom", align: "center", classes: "", **attributes) ⇒ PopoverContentComponent
constructor
A new instance of PopoverContentComponent.
Methods included from PopoverContentBehavior
#popover_content_classes, #popover_content_data_attributes, #popover_content_html_attributes
Constructor Details
#initialize(side: "bottom", align: "center", classes: "", **attributes) ⇒ PopoverContentComponent
Returns a new instance of PopoverContentComponent.
24 25 26 27 28 29 |
# File 'app/view_components/ui/popover_content_component.rb', line 24 def initialize(side: "bottom", align: "center", classes: "", **attributes) @side = side @align = align @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'app/view_components/ui/popover_content_component.rb', line 31 def call content_attrs = popover_content_html_attributes # Merge data attributes properly if @attributes[:data] content_attrs[:data] = content_attrs[:data].merge(@attributes[:data]) end content_tag :div, **content_attrs.deep_merge(@attributes.except(:data)) do content end end |