Rails: validating email in a model
I am importing an excel sheet containing (name, date of birth, email) and validating the email in the model with below code.
validates_format_of :email, :with => /^[a-z0-9_\+-]+(\.[a-z0-9_\+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.([a-z]{2,4})$/, :message => "Invalid email ID"
Now I have to show people with the wrong email format. Can I check this or in any other way ...
Thank you in advance
+3
source to share
3 answers
Go to http://my.rails-royce.org/2010/07/21/email-validation-in-ruby-on-rails-without-regexp/ This will really help you.
+3
source to share