heartcombo--simple_form/lib/simple_form/components/hints.rb

19 lines
426 B
Ruby
Raw Normal View History

module SimpleForm
module Components
# Needs to be enabled in order to do automatic lookups.
module Hints
def hint
@hint ||= begin
hint = options[:hint]
2012-03-07 13:59:35 +00:00
hint_content = hint.is_a?(String) ? hint : translate(:hints)
hint_content.html_safe if hint_content
end
2011-09-03 10:55:53 +00:00
end
def has_hint?
options[:hint] != false && hint.present?
end
end
end
end