Class: PhlexKit::FormFieldLabel
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::FormFieldLabel
- Defined in:
- app/components/phlex_kit/form_field/form_field_label.rb
Overview
Label for a PhlexKit::FormField control. Pass for: to bind it to the control's id
(e.g. for: f.field_id(:email)). Hidden when empty. See form_field.rb.
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ FormFieldLabel
constructor
A new instance of FormFieldLabel.
- #view_template(&block) ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ FormFieldLabel
Returns a new instance of FormFieldLabel.
5 6 7 |
# File 'app/components/phlex_kit/form_field/form_field_label.rb', line 5 def initialize(**attrs) @attrs = attrs end |
Instance Method Details
#view_template(&block) ⇒ Object
9 10 11 |
# File 'app/components/phlex_kit/form_field/form_field_label.rb', line 9 def view_template(&block) label(**mix({ class: "pk-form-field-label" }, @attrs), &block) end |