https://github.com/bigbinary/email_validator
Simple email validator for Rails 3.
https://github.com/bigbinary/email_validator
Last synced: about 2 months ago
JSON representation
Simple email validator for Rails 3.
- Host: GitHub
- URL: https://github.com/bigbinary/email_validator
- Owner: bigbinary
- Created: 2011-09-05T15:16:09.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2016-08-11T18:36:16.000Z (almost 9 years ago)
- Last Synced: 2025-02-04T21:43:25.072Z (4 months ago)
- Language: Ruby
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Introduction
This is an email validator for Rails 3.
I know it is a simple validator and I like simplicity. I just want to keep `john @msn.com` and `john@msncom` away.
Also it is not RFC compliant but that is okay with me.
## Usage
Add following lines to your `Gemfile`.
gem 'email_validator', :git => "git://github.com/bigbinary/email_validator.git"
In model add following lines of code
validates :email, :email => true
Outside models
EmailValidator.regex # returns the regex
EmailValidator.valid?('[email protected]')
## Testcd test
ruby email_test.rb