Class: Forms::FieldHint

Inherits:
Phlex::HTML
  • Object
show all
Defined in:
lib/forms/field_hint.rb

Overview

Inline hint/help text shown beneath a field.

Instance Method Summary collapse

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, **options)
  @text = text
  @options = options
  super()
end

Instance Method Details

#view_templateObject



12
13
14
15
16
# File 'lib/forms/field_hint.rb', line 12

def view_template
  return unless @text

  p(class: classes) { @text }
end