Module: GenericFormFor::Inputs::Base::Hint
- Included in:
- GenericFormFor::Inputs::Base
- Defined in:
- lib/generic_form_for/inputs/base/hint.rb
Instance Method Summary collapse
- #hint_html(config_options = {}) ⇒ Object
- #hint_html_options(config_options = {}) ⇒ Object
- #hint_text ⇒ Object
- #render_hint? ⇒ Boolean
Instance Method Details
#hint_html(config_options = {}) ⇒ Object
6 7 8 9 |
# File 'lib/generic_form_for/inputs/base/hint.rb', line 6 def hint_html(={}) return "" unless render_hint? template.concat template.content_tag(.delete(:tag) || :p, hint_text, ()) end |
#hint_html_options(config_options = {}) ⇒ Object
11 12 13 14 15 |
# File 'lib/generic_form_for/inputs/base/hint.rb', line 11 def (={}) opts = ([:hint_html] || {}).dup opts[:class] = [*opts[:class], *[:class]].compact.join(' ').strip .merge(opts) end |
#hint_text ⇒ Object
21 22 23 |
# File 'lib/generic_form_for/inputs/base/hint.rb', line 21 def hint_text render_hint? ? translate_hint([:hint]) : "" end |
#render_hint? ⇒ Boolean
17 18 19 |
# File 'lib/generic_form_for/inputs/base/hint.rb', line 17 def render_hint? .key?(:hint) end |