Validate email format in Rails
22 April 2022 (Updated 23 April 2022)
Add the following Active Record validation to a model (e.g., User
):
validates :email, format: { with: URI::MailTo::EMAIL_REGEXP }
Tagged:
Rails
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment