Validates_format_of :zipcode

how can I set the validation of the zipcode ?

you’ll want to try a regexp. look here for the code

it’s in there somewhere…
hope this helps