Module: SimpleForm::Components::Hints

Included in:
Inputs::Base
Defined in:
lib/simple_form/components/hints.rb

Instance Method Summary collapse

Instance Method Details

#hintObject



4
5
6
# File 'lib/simple_form/components/hints.rb', line 4

def hint
  template.(hint_tag, hint_text, hint_html_options) unless hint_text.blank?
end

#hint_html_optionsObject



16
17
18
# File 'lib/simple_form/components/hints.rb', line 16

def hint_html_options
  html_options_for(:hint, [SimpleForm.hint_class])
end

#hint_tagObject



8
9
10
# File 'lib/simple_form/components/hints.rb', line 8

def hint_tag
  options[:hint_tag] || SimpleForm.hint_tag
end

#hint_textObject



12
13
14
# File 'lib/simple_form/components/hints.rb', line 12

def hint_text
  @hint_text ||= options[:hint] || translate(:hints)
end