aboutsummaryrefslogblamecommitdiffstats
path: root/actionpack/lib/action_view/helpers/tags/number_field.rb
blob: 9cd04434f0cd711c07070fb9cef96c4871b8437e (plain) (tree)
1
2
3
4
5
6





                                            











                                                                     
module ActionView
  module Helpers
    module Tags
      class NumberField < TextField #:nodoc:
        def render
          options = @options.stringify_keys

          if range = options.delete("in") || options.delete("within")
            options.update("min" => range.min, "max" => range.max)
          end

          @options = options
          super
        end
      end
    end
  end
end