Sha256: ea7db5c700c6dea57dced1e60fb4a0ff2fbf222dbe9d8c6202f18f2485b954b6

Contents?: true

Size: 642 Bytes

Versions: 22

Compression:

Stored size: 642 Bytes

Contents

module Formtastic
  module Inputs
    module Base
      module Hints
        
        def hint_html
          if hint?
            template.content_tag(
              :p, 
              Formtastic::Util.html_safe(hint_text), 
              :class => (options[:hint_class] || builder.default_hint_class)
            )
          end
        end
        
        def hint?
          !hint_text.blank? && !hint_text.kind_of?(Hash)
        end

        def hint_text
          localized_string(method, options[:hint], :hint)
        end
        
        def hint_text_from_options
          options[:hint]
        end

      end
    end
  end
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
formtastic-2.3.1 lib/formtastic/inputs/base/hints.rb
formtastic-2.3.0 lib/formtastic/inputs/base/hints.rb
formtastic-2.3.0.rc4 lib/formtastic/inputs/base/hints.rb
formtastic-2.3.0.rc3 lib/formtastic/inputs/base/hints.rb
formtastic-2.3.0.rc2 lib/formtastic/inputs/base/hints.rb
formtastic-2.3.0.rc lib/formtastic/inputs/base/hints.rb
formtastic-2.2.1 lib/formtastic/inputs/base/hints.rb
formtastic-2.2.0 lib/formtastic/inputs/base/hints.rb
formtastic-2.2.0.rc lib/formtastic/inputs/base/hints.rb
formtastic-2.1.1 lib/formtastic/inputs/base/hints.rb
formtastic-2.1.0 lib/formtastic/inputs/base/hints.rb
formtastic-2.1.0.rc lib/formtastic/inputs/base/hints.rb
formtastic-2.1.0.beta1 lib/formtastic/inputs/base/hints.rb
formtastic-2.0.2 lib/formtastic/inputs/base/hints.rb
formtastic-2.0.1 lib/formtastic/inputs/base/hints.rb
formtastic-2.0.0 lib/formtastic/inputs/base/hints.rb
formtastic-2.0.0.rc5 lib/formtastic/inputs/base/hints.rb
formtastic-2.0.0.rc4 lib/formtastic/inputs/base/hints.rb
formtastic-2.0.0.rc3 lib/formtastic/inputs/base/hints.rb
formtastic-2.0.0.rc2 lib/formtastic/inputs/base/hints.rb