Sha256: eb26014e722d6689a5658aa4e1d6ba1d8787d433b93675c0fb863d8a415959f7

Contents?: true

Size: 403 Bytes

Versions: 28

Compression:

Stored size: 403 Bytes

Contents

module SimpleForm
  module Components
    # Needs to be enabled in order to do automatic lookups.
    module Placeholders
      def placeholder
        input_html_options[:placeholder] ||= placeholder_text
        nil
      end

      def placeholder_text
        placeholder = options[:placeholder]
        placeholder.is_a?(String) ? placeholder : translate(:placeholders)
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 4 rubygems

Version Path
simple_form-3.0.4 lib/simple_form/components/placeholders.rb
simple_form-2.1.3 lib/simple_form/components/placeholders.rb
simple_form-2.1.2 lib/simple_form/components/placeholders.rb
simple_form-3.0.3 lib/simple_form/components/placeholders.rb
simple_form-3.0.2 lib/simple_form/components/placeholders.rb
simple_form-3.0.1 lib/simple_form/components/placeholders.rb
simple_form-2.1.1 lib/simple_form/components/placeholders.rb
simple_form-3.0.0 lib/simple_form/components/placeholders.rb
simple_form_awesome-2.5.0 lib/simple_form/components/placeholders.rb
simple_form_awesome-2.4.0 lib/simple_form/components/placeholders.rb
simple_form_awesome-2.3.0 lib/simple_form/components/placeholders.rb
simple_form_awesome-2.2.0 lib/simple_form/components/placeholders.rb
simple_form-3.0.0.rc lib/simple_form/components/placeholders.rb
simple_form-2.1.0 lib/simple_form/components/placeholders.rb
simple_form-3.0.0.beta1 lib/simple_form/components/placeholders.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.4/lib/simple_form/components/placeholders.rb
simple_form-2.0.4 lib/simple_form/components/placeholders.rb
simple_form-2.0.3 lib/simple_form/components/placeholders.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.2/lib/simple_form/components/placeholders.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.2/lib/simple_form/components/placeholders.rb