Sha256: 1d89c3578b5261a0afca3627e98e2d038908ba6ffa06680d08b3e0f185fa57e4

Contents?: true

Size: 410 Bytes

Versions: 7

Compression:

Stored size: 410 Bytes

Contents

module SimpleForm
  module Inputs
    class NumericInput < Base
      enable :placeholder, :min_max

      def input
        input_html_classes.unshift("numeric")
        if html5?
          input_html_options[:type] ||= "number"
          input_html_options[:step] ||= integer? ? 1 : "any"
        end
        @builder.text_field(attribute_name, input_html_options)
      end

      private
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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