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
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.2/lib/simple_form/components/placeholders.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.2/lib/simple_form/components/placeholders.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.2/lib/simple_form/components/placeholders.rb
simple_form-2.0.2 lib/simple_form/components/placeholders.rb
ehoch_simple_form-2.0.2.dev lib/simple_form/components/placeholders.rb
simple_form-2.0.1 lib/simple_form/components/placeholders.rb
simple_form-2.0.0 lib/simple_form/components/placeholders.rb
simple_form-2.0.0.rc lib/simple_form/components/placeholders.rb