Skip to content

Instantly share code, notes, and snippets.

@luigi
Created July 25, 2008 02:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luigi/2369 to your computer and use it in GitHub Desktop.
Save luigi/2369 to your computer and use it in GitHub Desktop.
validates_presence_of :first_name, :last_name, :zip
validates_length_of :password, :within => 6..40, :if => :password_required?
validates_confirmation_of :password, :if => :password_required?
validates_length_of :login, :within => 2..50, :too_short => "email must be at least 2 characters", :too_long => "email is too long!"
validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i, :message => "is not formatted properly"
validates_uniqueness_of :email, :case_sensitive => false, :message => "is already in the system"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment