Theocacao
Leopard
Design Element
Comment on "Rails validates_length_of and Fixnum"
by Lee N — Nov 01
The validates_* rules are applied to the models, not the controllers, so they deal with the model types of the data, not with the input text.

Also, it's pretty traditional to make a telephone or zip a string anyway, since you're not likely to be doing numeric calculations on it, but are likely to reformat it. Do you have a reason for going numeric here?
Back to "Rails validates_length_of and Fixnum"
Design Element

Copyright © Scott Stevenson 2004-2015