This work is based on http://github.com/gbdev/validates_as_email.
This Ruby on Rails plugin implements an ActiveRecord validation helper called validates_as_email. The helper acts as if validates_format_of was used with a regular expression used on auto_link helper.
The plugin implements the regular expression here.
$ ruby script/plugin install http://github.com/sobrinho/validates_as_email.git
In your model file do something like:
class Person < ActiveRecord::Base validates_as_email :email end
$ cd vendor/plugins/validates_as_email $ rake test
See the LICENSE file.
Copyright © 2010 Gabriel Sobrinho <[email protected]>