public
Description: El Dorado is a full-stack community web application written in Ruby/Rails.
Homepage: http://almosteffortless.com/eldorado/
Clone URL: git://github.com/trevorturk/el-dorado.git
Email validation on new user registration
Elk (author)
Thu May 08 15:33:11 -0700 2008
commit  678fb74cd4f28da36e25c5937f919d45db09a498
tree    422776484f34e0f0a9fe7535296d98ace90e8b9f
parent  5673172b5891a491d1a5f3ae6170031e4a7b29c2
...
43
44
45
 
 
 
46
47
48
...
43
44
45
46
47
48
49
50
51
0
@@ -43,6 +43,9 @@ class User < ActiveRecord::Base
0
   validates_confirmation_of :password, :on => :create
0
   validates_confirmation_of :password, :on => :update, :allow_blank => true
0
   
0
+ validates_format_of :email, :on => :create,
0
+ :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i
0
+
0
   before_create :set_defaults
0
   
0
   composed_of :tz, :class_name => 'TZInfo::Timezone', :mapping => %w( time_zone time_zone )

Comments

    No one has commented yet.