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
"
Copyright © Scott Stevenson 2004-2015
by ben — Nov 02
zipcode = 12345
case zipcode
when 10000..99999 then puts "Ok!"
else puts "No five digits!"
end