-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME
More file actions
48 lines (36 loc) · 1.37 KB
/
Copy pathREADME
File metadata and controls
48 lines (36 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
ValidatesAsEmail
================
This gem/plugin is a re-packaged and gem'ified version of the original plugin with credit as follows:
Gabriel Mazetto <brodock@gmail.com>
Donncha Redmond <dredmond@e-xact.com>
Michal Zima <xhire@mujmalysvet.cz>
Ximon Eighteen <ximon.eighteen@int.greenpeace.org>
Dan Kubb <dan.kubb@autopilotmarketing.com>
Thijs van der Vossen <thijs@fngtps.com>
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 that defines an email address conformance test.
It does not follow any RFC as RFC822, RFC2822, RFC3696 as it's intended for common bn
Installation:
=============
Make sure you have rubygems >= 1.3.6
Install the gem(s):
sudo gem install brodock-validates_as_email
Add to environment.rb initializer block:
config.gem 'brodock-validates_as_email', :lib => 'validates_as_email'
Usage:
======
In your model file do something like:
class MyClass < ActiveRecord::Base
validates_as_email :email, :message => 'Invalid Email Address', :allow_nil => true
end
class MyOtherClass < ActiveRecord::Base
# will not accept addresses with a single part domain, e.g user@example
validates_as_email :email, :message => 'Invalid Email Address', :allow_nil => true
end
Tests:
======
Some tests have been added.
License:
========
See the LICENSE file.