Sha256: 5b2e51a2fcbc7f289fd7de195bb530316a015de173b8841e6313b5cf7f35d112

Contents?: true

Size: 441 Bytes

Versions: 12

Compression:

Stored size: 441 Bytes

Contents

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

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

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
simple_form-3.5.0 lib/simple_form/components/placeholders.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/simple_form-3.4.0/lib/simple_form/components/placeholders.rb
simple_form-3.4.0 lib/simple_form/components/placeholders.rb
simple_form-3.3.1 lib/simple_form/components/placeholders.rb
simple_form-3.3.0 lib/simple_form/components/placeholders.rb
simple_form-3.2.1 lib/simple_form/components/placeholders.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/simple_form-3.2.0/lib/simple_form/components/placeholders.rb
simple_form-3.2.0 lib/simple_form/components/placeholders.rb
simple_form-3.1.1 lib/simple_form/components/placeholders.rb
simple_form-3.1.0 lib/simple_form/components/placeholders.rb
simple_form-3.1.0.rc2 lib/simple_form/components/placeholders.rb
simple_form-3.1.0.rc1 lib/simple_form/components/placeholders.rb