Module: SimpleForm::Components::Hints

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

Overview

Needs to be enabled in order to do automatic lookups.

Instance Method Summary collapse

Instance Method Details

#has_hint?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/simple_form/components/hints.rb', line 18

def has_hint?
  options[:hint] != false && hint.present?
end

#hintObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/simple_form/components/hints.rb', line 5

def hint
  @hint ||= begin
    hint = options[:hint]

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