validates_format_of :zipcode, :with=>/\A[0-9]{5}\Z/, :if=>:zipcode?
Copyright © Scott Stevenson 2004-2015
by John Sturgeon — Oct 09
validates_format_of :zipcode, :with=>/\A[0-9]{5}\Z/, :if=>:zipcode?