Validate email using validates_formatting_of
This commit is contained in:
parent
b311063ed7
commit
6caf8ef8e8
|
@ -4,7 +4,7 @@ class User < ActiveRecord::Base
|
|||
attr_accessible :address_1, :address_2, :city, :email, :name, :organization,
|
||||
:password, :password_confirmation, :remember_me, :sms_number, :state,
|
||||
:voice_number, :zip
|
||||
validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i
|
||||
validates_formatting_of :email, :using => :email
|
||||
validates_formatting_of :sms_number, :using => :us_phone, :allow_blank => true
|
||||
validates_formatting_of :voice_number, :using => :us_phone, :allow_blank => true
|
||||
validates_formatting_of :zip, :using => :us_zip, :allow_blank => true
|
||||
|
|
Loading…
Reference in New Issue