Class: Forms::FieldHint
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- Forms::FieldHint
- Defined in:
- lib/forms/field_hint.rb
Overview
Inline hint/help text shown beneath a field.
Instance Method Summary collapse
-
#initialize(text: nil, **options) ⇒ FieldHint
constructor
A new instance of FieldHint.
- #view_template ⇒ Object
Constructor Details
#initialize(text: nil, **options) ⇒ FieldHint
Returns a new instance of FieldHint.
6 7 8 9 10 |
# File 'lib/forms/field_hint.rb', line 6 def initialize(text: nil, **) @text = text @options = super() end |
Instance Method Details
#view_template ⇒ Object
12 13 14 15 16 |
# File 'lib/forms/field_hint.rb', line 12 def view_template return unless @text p(class: classes) { @text } end |