You are here: Browse Railsplugins Validates Numericality Of
Adds the following parameters in order of precedence, can be combined to generate unique constraints:
(the messages show what is generated as an error)
:gt => ## “must be greater than ##” :gte => ## “must be greater than or equal to ##” :eq => ## “must be equal to ##” :lt => ## “must be less than ##” :lte => ## “must be less than or equal to ##” :odd => ## “must be an odd number” :even => ## “must be an even number”
class Game < ActiveRecord::Base
validates_numericality_of :pick_an_even_number_greater_than_4, {:gt => 4, :even => true}
end
You can submit bug reports of suggestions for improvements to “ruby” “at” “bobsilva.com”
2006-01-27 – Initial release – version 0.1
NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly