Validates_as_email is a project mainly written in Ruby, it's free.
rails validation plugin. validates email addresses
Validation module for email addresses.
You can install the plugin the traditional way. Go to your application root and do:
script/plugin install git://github.com/paulschreiber/validates_as_email.git
class Person < ActiveRecord::Base validates_as_email :email end
p = Person.new(:email => "Bob") p.valid? # false
p = Person.new(:email => "[email protected]") p.valid? # true
Just like with built-in ActiveRecord validations, you can optionally supply a :message parameter with a custom error. Or, you can use Rails' built-in localization system and
= License
Copyright (c) 2010 Paul Schreiber, released under the MIT license