If you want to use validates_length_of without validates_presence_of, you have to specify the :allow_nil option. Otherwise the statement would also implicitly validate the presence:
validates_length_of :zipcode, :within => 0..10, :allow_nil => true
Check out the Rails API on validates_length_of.
9 notes 0 comments (via rubeh)
If you want to use...without validates_presence_of, you have to specify the :allow_nil...
You can use HTML tags for formatting. Wrap code in <code> tags and multiple lines of code in <pre><code> tags.