Skip to content

Instantly share code, notes, and snippets.

@frankolson
Last active October 31, 2019 20:23
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 frankolson/96fdd5706b779d52d7fbbdc201f1cc8f to your computer and use it in GitHub Desktop.
Save frankolson/96fdd5706b779d52d7fbbdc201f1cc8f to your computer and use it in GitHub Desktop.
Email validation in rails
class SomeModel < ApplicationRecord
validates :email, format: {
with: URI::MailTo::EMAIL_REGEXP,
message: 'requires a valid email format'
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment