Valid email? Validate email addresses in Rails!
# our User model
class User < ActiveRecord::Base
validates_presence_of :email
validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i
end
# our User model
class User < ActiveRecord::Base
validates_presence_of :email
validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i
end