Skip to content

Instantly share code, notes, and snippets.

@pierot
Created January 22, 2011 18:24
Show Gist options
  • Select an option

  • Save pierot/791322 to your computer and use it in GitHub Desktop.

Select an option

Save pierot/791322 to your computer and use it in GitHub Desktop.
validates_presence_of :first_name, :last_name, :email
validates_uniqueness_of :email, :case_sensitive => false
validates_format_of :email, :with => /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates_length_of :first_name, :last_name, :minimum => 2, :maximum => 50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment