Module: SimpleFormWithClientValidation::Components::Hints

Included in:
Inputs::Base
Defined in:
lib/simple_form_with_client_validation/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)


13
14
15
# File 'lib/simple_form_with_client_validation/components/hints.rb', line 13

def has_hint?
  hint.present?
end

#hintObject



5
6
7
8
9
10
11
# File 'lib/simple_form_with_client_validation/components/hints.rb', line 5

def hint
  @hint ||= begin
    hint = options[:hint]
    hint_content = hint.is_a?(String) ? hint : translate(:hints)
    hint_content.html_safe if hint_content
  end
end