module SimpleForm::Components::Hints

Needs to be enabled in order to do automatic lookups.

Public Instance Methods

has_hint?() click to toggle source
# File lib/simple_form/components/hints.rb, line 18
def has_hint?
  options[:hint] != false && hint.present?
end
hint(wrapper_options = nil) click to toggle source
# File lib/simple_form/components/hints.rb, line 5
def hint(wrapper_options = nil)
  @hint ||= begin
    hint = options[:hint]

    if hint.is_a?(String)
      html_escape(hint)
    else
      content = translate_from_namespace(:hints)
      content.html_safe if content
    end
  end
end