Class: UI::FieldSeparator
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- UI::FieldSeparator
- Includes:
- FieldSeparatorBehavior
- Defined in:
- app/components/ui/field_separator.rb
Overview
Separator - Phlex implementation
Visual divider to separate sections inside FieldGroup. Uses FieldSeparatorBehavior concern for shared styling logic.
Instance Method Summary collapse
-
#initialize(classes: "", **attributes) ⇒ FieldSeparator
constructor
A new instance of FieldSeparator.
- #view_template(&block) ⇒ Object
Methods included from FieldSeparatorBehavior
#field_separator_classes, #field_separator_html_attributes, #has_content?
Constructor Details
#initialize(classes: "", **attributes) ⇒ FieldSeparator
Returns a new instance of FieldSeparator.
18 19 20 21 22 |
# File 'app/components/ui/field_separator.rb', line 18 def initialize(classes: "", **attributes) @classes = classes @attributes = attributes @block_given = false end |
Instance Method Details
#view_template(&block) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/components/ui/field_separator.rb', line 24 def view_template(&block) @block_given = block_given? div(**field_separator_html_attributes) do if @block_given render_with_label(&block) else render_line_only end end end |