module Formular::Element::Modules::Hint::InstanceMethods

options functionality (same as SimpleForm): options == String return the string

Public Instance Methods

has_hint?() click to toggle source
# File lib/formular/element/modules/hint.rb, line 19
def has_hint?
  options[:hint].is_a?(String)
end
hint_text() click to toggle source
# File lib/formular/element/modules/hint.rb, line 15
def hint_text
  html_escape(options[:hint]) if has_hint?
end

Private Instance Methods

hint_id() click to toggle source
# File lib/formular/element/modules/hint.rb, line 24
def hint_id
  return hint_options[:id] if hint_options[:id]

  id = options[:id] || form_encoded_id
  "#{id}_hint" if id
end
hint_options() click to toggle source
# File lib/formular/element/modules/hint.rb, line 31
def hint_options
  @hint_options ||= options[:hint_options] || {}
end