Class: UI::DialogContentComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::DialogContentComponent
- Includes:
- DialogContentBehavior
- Defined in:
- app/view_components/ui/dialog_content_component.rb
Overview
Dialog content component (ViewComponent) Main content area for the dialog
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(open: false, classes: "", **attributes) ⇒ DialogContentComponent
constructor
A new instance of DialogContentComponent.
Methods included from DialogContentBehavior
#dialog_content_base_classes, #dialog_content_classes, #dialog_content_data_attributes, #dialog_content_html_attributes, #merged_dialog_content_data_attributes
Constructor Details
#initialize(open: false, classes: "", **attributes) ⇒ DialogContentComponent
Returns a new instance of DialogContentComponent.
16 17 18 19 20 |
# File 'app/view_components/ui/dialog_content_component.rb', line 16 def initialize(open: false, classes: "", **attributes) @open = open @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
22 23 24 25 26 27 |
# File 'app/view_components/ui/dialog_content_component.rb', line 22 def call attrs = dialog_content_html_attributes attrs[:data] = attrs[:data].merge(@attributes.fetch(:data, {})) content_tag :div, content, **attrs.merge(@attributes.except(:data)) end |