Sha256: 7f372289147f36b41ac7109da69d91d3092577e3bd5b6b0bf289e2d3c00ec2b8

Contents?: true

Size: 480 Bytes

Versions: 5

Compression:

Stored size: 480 Bytes

Contents

module SimpleForm
  module Components
    module Placeholders
      def placeholder
        input_html_options[:placeholder] ||= placeholder_text if has_placeholder?
        nil
      end

      def has_placeholder?
        false
      end

      def placeholder_present?
        options[:placeholder] != false && placeholder_text.present?
      end

      def placeholder_text
        @placeholder ||= options[:placeholder] || translate(:placeholders)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
simple_form-1.4.2 lib/simple_form/components/placeholders.rb
simple_form-1.4.1 lib/simple_form/components/placeholders.rb
simple_form-1.4.0 lib/simple_form/components/placeholders.rb
simple_form-1.3.1 lib/simple_form/components/placeholders.rb
simple_form-1.3.0 lib/simple_form/components/placeholders.rb