Class: UI::FieldSeparatorComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::FieldSeparatorComponent
- Includes:
- FieldSeparatorBehavior
- Defined in:
- app/view_components/ui/field_separator_component.rb
Overview
FieldSeparatorComponent - ViewComponent implementation
Visual divider to separate sections inside FieldGroup. Uses FieldSeparatorBehavior concern for shared styling logic.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(classes: "", **attributes) ⇒ FieldSeparatorComponent
constructor
A new instance of FieldSeparatorComponent.
Methods included from FieldSeparatorBehavior
#field_separator_classes, #field_separator_html_attributes, #has_content?
Constructor Details
#initialize(classes: "", **attributes) ⇒ FieldSeparatorComponent
Returns a new instance of FieldSeparatorComponent.
20 21 22 23 |
# File 'app/view_components/ui/field_separator_component.rb', line 20 def initialize(classes: "", **attributes) @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'app/view_components/ui/field_separator_component.rb', line 25 def call content_tag :div, **field_separator_html_attributes do if content? render_with_label else render_line_only end end end |