Sha256: cb57272f70b26940d0e82f6dc3aac56a641eaf84095fd1e24838dbdd0d9c2dea

Contents?: true

Size: 438 Bytes

Versions: 7

Compression:

Stored size: 438 Bytes

Contents

module SimpleForm
  module Inputs
    class StringInput < Base
      enable :placeholder, :maxlength, :pattern

      def input
        unless string?
          input_html_classes.unshift("string")
          input_html_options[:type] ||= input_type if html5?
        end

        @builder.text_field(attribute_name, input_html_options)
      end

      private

      def string?
        input_type == :string
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
simple_form-3.0.4 lib/simple_form/inputs/string_input.rb
simple_form-3.0.3 lib/simple_form/inputs/string_input.rb
simple_form-3.0.2 lib/simple_form/inputs/string_input.rb
simple_form-3.0.1 lib/simple_form/inputs/string_input.rb
simple_form-3.0.0 lib/simple_form/inputs/string_input.rb
simple_form-3.0.0.rc lib/simple_form/inputs/string_input.rb
simple_form-3.0.0.beta1 lib/simple_form/inputs/string_input.rb