Class: Railsboot::FormField::CaptionComponent
- Inherits:
-
Component
- Object
- Component
- Railsboot::FormField::CaptionComponent
- Defined in:
- app/components/railsboot/form_field/caption_component.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(tag: "div", **html_attributes) ⇒ CaptionComponent
constructor
A new instance of CaptionComponent.
Constructor Details
#initialize(tag: "div", **html_attributes) ⇒ CaptionComponent
Returns a new instance of CaptionComponent.
2 3 4 5 6 7 8 9 10 |
# File 'app/components/railsboot/form_field/caption_component.rb', line 2 def initialize(tag: "div", **html_attributes) @tag = tag @html_attributes = html_attributes @html_attributes[:class] = class_names( "form-text", html_attributes[:class] ) end |
Instance Method Details
#call ⇒ Object
12 13 14 |
# File 'app/components/railsboot/form_field/caption_component.rb', line 12 def call render(Railsboot::BaseComponent.new(tag: @tag, **@html_attributes)) { content } end |