Class: UI::FieldLabelComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::FieldLabelComponent
- Includes:
- FieldLabelBehavior
- Defined in:
- app/view_components/ui/field_label_component.rb
Overview
FieldLabelComponent - ViewComponent implementation
Label styled for form fields with disability states. Uses FieldLabelBehavior concern for shared styling logic.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(for_id: nil, classes: "", **attributes) ⇒ FieldLabelComponent
constructor
A new instance of FieldLabelComponent.
Methods included from FieldLabelBehavior
#field_label_classes, #field_label_html_attributes
Constructor Details
#initialize(for_id: nil, classes: "", **attributes) ⇒ FieldLabelComponent
Returns a new instance of FieldLabelComponent.
18 19 20 21 22 |
# File 'app/view_components/ui/field_label_component.rb', line 18 def initialize(for_id: nil, classes: "", **attributes) @for_id = for_id @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
24 25 26 27 28 |
# File 'app/view_components/ui/field_label_component.rb', line 24 def call content_tag :label, **field_label_html_attributes do content end end |