Sha256: 5784ff6a4308e833717e52b10a993f770c7d9d6ebf5a321f5b55b43ede554e56

Contents?: true

Size: 517 Bytes

Versions: 12

Compression:

Stored size: 517 Bytes

Contents

module SimpleForm
  module Components
    # Needs to be enabled in order to do automatic lookups.
    module Hints
      def hint(wrapper_options = nil)
        @hint ||= begin
          hint = options[:hint]

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

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

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
simple_form-3.5.0 lib/simple_form/components/hints.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/simple_form-3.4.0/lib/simple_form/components/hints.rb
simple_form-3.4.0 lib/simple_form/components/hints.rb
simple_form-3.3.1 lib/simple_form/components/hints.rb
simple_form-3.3.0 lib/simple_form/components/hints.rb
simple_form-3.2.1 lib/simple_form/components/hints.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/simple_form-3.2.0/lib/simple_form/components/hints.rb
simple_form-3.2.0 lib/simple_form/components/hints.rb
simple_form-3.1.1 lib/simple_form/components/hints.rb
simple_form-3.1.0 lib/simple_form/components/hints.rb
simple_form-3.1.0.rc2 lib/simple_form/components/hints.rb
simple_form-3.1.0.rc1 lib/simple_form/components/hints.rb