Class: UI::FieldLegendComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::FieldLegendComponent
- Includes:
- FieldLegendBehavior
- Defined in:
- app/view_components/ui/field_legend_component.rb
Overview
FieldLegendComponent - ViewComponent implementation
Legend element for FieldSet with variant support. Uses FieldLegendBehavior concern for shared styling logic.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(variant: "legend", classes: "", **attributes) ⇒ FieldLegendComponent
constructor
A new instance of FieldLegendComponent.
Methods included from FieldLegendBehavior
#field_legend_classes, #field_legend_html_attributes
Constructor Details
#initialize(variant: "legend", classes: "", **attributes) ⇒ FieldLegendComponent
Returns a new instance of FieldLegendComponent.
23 24 25 26 27 |
# File 'app/view_components/ui/field_legend_component.rb', line 23 def initialize(variant: "legend", classes: "", **attributes) @variant = variant @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
29 30 31 32 33 |
# File 'app/view_components/ui/field_legend_component.rb', line 29 def call content_tag :legend, **field_legend_html_attributes do content end end |