Class: FormProps::Inputs::NumberField

Inherits:
TextField
  • Object
show all
Defined in:
lib/form_props/inputs/number_field.rb

Direct Known Subclasses

RangeField

Instance Method Summary collapse

Methods inherited from Base

#initialize, #json

Constructor Details

This class inherits a constructor from FormProps::Inputs::Base

Instance Method Details

#renderObject



6
7
8
9
10
11
12
# File 'lib/form_props/inputs/number_field.rb', line 6

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

  super
end