Sha256: 98e455646dfbf7526f2d1f1a951d13290ffb6fd57b5fda53eb6f9dbad419b1e7

Contents?: true

Size: 479 Bytes

Versions: 7

Compression:

Stored size: 479 Bytes

Contents

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

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

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
simple_form-3.0.4 lib/simple_form/components/hints.rb
simple_form-2.1.3 lib/simple_form/components/hints.rb
simple_form-2.1.2 lib/simple_form/components/hints.rb
simple_form-3.0.3 lib/simple_form/components/hints.rb
simple_form-3.0.2 lib/simple_form/components/hints.rb
simple_form-3.0.1 lib/simple_form/components/hints.rb
simple_form-2.1.1 lib/simple_form/components/hints.rb