Sha256: 4e71e279e879daeba599a6ec03f8915f599abace8d573e23b36a43ed966a0442

Contents?: true

Size: 574 Bytes

Versions: 3

Compression:

Stored size: 574 Bytes

Contents

module SimpleForm
  module Components
    module Hints
      def hint
        enabled_hint
      end

      private

      def enabled_hint
        template.content_tag(hint_tag, hint_text, hint_html_options) unless hint_text.blank?
      end

      def disabled_hint
        nil
      end

      def hint_tag
        options[:hint_tag] || SimpleForm.hint_tag
      end

      def hint_text
        @hint_text ||= options[:hint] || translate(:hints)
      end

      def hint_html_options
        html_options_for(:hint, [SimpleForm.hint_class])
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
simple_form-1.5.2 lib/simple_form/components/hints.rb
simple_form-1.5.1 lib/simple_form/components/hints.rb
simple_form-1.5.0 lib/simple_form/components/hints.rb