Sha256: 13c3b97bac4aa424846b0fd01059d2e5fa99acaf36c96ced0f45e090effc502b

Contents?: true

Size: 494 Bytes

Versions: 10

Compression:

Stored size: 494 Bytes

Contents

# frozen_string_literal: true
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(wrapper_options = nil)
        placeholder = options[:placeholder]
        placeholder.is_a?(String) ? placeholder : translate_from_namespace(:placeholders)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
simple_form-5.3.0 lib/simple_form/components/placeholders.rb
simple_form-5.2.0 lib/simple_form/components/placeholders.rb
simple_form-5.1.0 lib/simple_form/components/placeholders.rb
simple_form-5.0.3 lib/simple_form/components/placeholders.rb
simple_form-5.0.2 lib/simple_form/components/placeholders.rb
simple_form-5.0.1 lib/simple_form/components/placeholders.rb
simple_form-5.0.0 lib/simple_form/components/placeholders.rb
simple_form-4.1.0 lib/simple_form/components/placeholders.rb
simple_form-4.0.1 lib/simple_form/components/placeholders.rb
simple_form-4.0.0 lib/simple_form/components/placeholders.rb