Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (18 sloc) 948 Bytes

ValidatesAsEmail

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.

Installation

$ ruby script/plugin install http://github.com/sobrinho/validates_as_email.git

Usage

In your model file do something like:

class Person < ActiveRecord::Base
  validates_as_email :email
end

Tests

$ cd vendor/plugins/validates_as_email
$ rake test

License

See the LICENSE file.

Copyright

Copyright © 2010 Gabriel Sobrinho <gabriel.sobrinho@gmail.com>

Jump to Line
Something went wrong with that request. Please try again.