Class: UI::FieldLabel
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- UI::FieldLabel
- Includes:
- FieldLabelBehavior
- Defined in:
- app/components/ui/field_label.rb
Overview
Label - Phlex implementation
Label styled for form fields with disability states. Uses FieldLabelBehavior concern for shared styling logic.
Instance Method Summary collapse
-
#initialize(for_id: nil, classes: "", **attributes) ⇒ FieldLabel
constructor
A new instance of FieldLabel.
- #view_template(&block) ⇒ Object
Methods included from FieldLabelBehavior
#field_label_classes, #field_label_html_attributes
Constructor Details
#initialize(for_id: nil, classes: "", **attributes) ⇒ FieldLabel
Returns a new instance of FieldLabel.
16 17 18 19 20 |
# File 'app/components/ui/field_label.rb', line 16 def initialize(for_id: nil, classes: "", **attributes) @for_id = for_id @classes = classes @attributes = attributes end |
Instance Method Details
#view_template(&block) ⇒ Object
22 23 24 25 26 |
# File 'app/components/ui/field_label.rb', line 22 def view_template(&block) label(**field_label_html_attributes) do yield if block_given? end end |