Sha256: f08cbee8ec5a04d1c53185856a5a48e3cc4a8f04c22380b358362bbd25c2a3aa

Contents?: true

Size: 512 Bytes

Versions: 12

Compression:

Stored size: 512 Bytes

Contents

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

      def input(wrapper_options = nil)
        input_html_classes.unshift("numeric")
        if html5?
          input_html_options[:type] ||= "number"
          input_html_options[:step] ||= integer? ? 1 : "any"
        end

        merged_input_options = merge_wrapper_options(input_html_options, wrapper_options)

        @builder.text_field(attribute_name, merged_input_options)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

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