Theocacao
Leopard
Design Element
Comment on "Rails validates_length_of and Fixnum"
by ben — Nov 02
To validate a fixnum zipcode you may use case:

zipcode = 12345

case zipcode
when 10000..99999 then puts "Ok!"
else puts "No five digits!"
end
Back to "Rails validates_length_of and Fixnum"
Design Element

Copyright © Scott Stevenson 2004-2015