I am new to ruby/rails and am having a problem with validates_length_of.
It seems to work fine on a varchar field, but when I try it on a char
field the extra characters are silently truncated and the message
appears that the record was successfully updated.
How can I get my app to produce my error message instead? I’ve tried
various variations, but here’s one of my tries:
validates_length_of :State, :minimum => 2, :maximum => 2,
:message => “Use the two-letter state abbreviation”
I know I can use a drop-down list instead (that’s my next exercise) but
I’d like to know how to do this for other char fields as well. Or is the
char issue a red herring and something else is wrong with my code?