Rails validate email


/ Published in: Ruby
Save to your folder(s)



Copy this code and paste it in your HTML
  1. validates_format_of :email,
  2. :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i,
  3. :message => 'email must be valid'

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.