https://github.com/johnvuko/validates_email_format_of
A plugin for validate format of email and blacklist some domains.
https://github.com/johnvuko/validates_email_format_of
Last synced: about 1 year ago
JSON representation
A plugin for validate format of email and blacklist some domains.
- Host: GitHub
- URL: https://github.com/johnvuko/validates_email_format_of
- Owner: johnvuko
- Created: 2011-12-25T19:40:44.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2012-12-13T06:24:16.000Z (over 13 years ago)
- Last Synced: 2025-06-10T00:42:47.635Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 117 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
validates_email_format_of
======================
A plugin for validate format of email and blacklist or whitelist some domains.
Installation
------------
Include the gem in your Gemfile:
gem 'validates_email_format_of', :git => 'https://github.com/jonathantribouharet/validates_email_format_of'
Usage
-----
In your model:
class User < ActiveRecord::Base
validates :email, :email => true
end
Or
class User < ActiveRecord::Base
validates_email_format_of :email
end
For blacklist or whitelist some domains add in a initializer:
EmailValidator.blacklist_domains = ['yopmail.com', 'jetable.org']
EmailValidator.whitelist_domains = ['gmail.com', 'hotmail.com']
I18n support
------------
* `errors.messages.not_an_email_adress` is used for an invalid format
* `errors.messages.not_a_valid_email_adress` is used for an invalid domain
Warning
-------
The validation downcase the email.