Last active
October 31, 2019 20:23
-
-
Save frankolson/96fdd5706b779d52d7fbbdc201f1cc8f to your computer and use it in GitHub Desktop.
Email validation in rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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