Skip to content

Instantly share code, notes, and snippets.

@TXDynamics
Created April 23, 2013 17:55
Show Gist options
  • Select an option

  • Save TXDynamics/5445838 to your computer and use it in GitHub Desktop.

Select an option

Save TXDynamics/5445838 to your computer and use it in GitHub Desktop.
Ruby validated email address
validates :name, presence: true, length: {maximum: 50}
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :email, presence: true , format: { with: VALID_EMAIL_REGEX }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment