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

                 

                                             

                                           











                                                                     
module ActionView
  module Helpers
    module Tags # :nodoc:
      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