Rails zip_code validations with prefix zero issue

rails if we make zip_code as integer value in database it will not gives
the zip_code validations when we give zip_code as 01234 it takes as 1234
like all prefix zeros

solution:-

we have to to make zip_code as string then it will validates zip_code
properly to all zip_codes like 01234

Comments

Popular posts from this blog

Rails Memcache issues

Enabling password authentication for new ec2 box | ssh, ssh config, EC2 setup, new user in EC2, PasswordAuthentication

Ruby on Rails 3.x Skip callback and validation and reset Callback | Ruby on Rails, Skip callback, validation, reset Callback