On Wed, Oct 10, 2012 at 8:59 AM, jude <judear...@gmail.com> wrote:
> class Person < ActiveRecord::Base validates_format_of :email, :with =>
> %r\A([^@\s]+)@((?:[-a-z0-9]+.)+[a-z]{2,})\Z/, :on => :create end

> validates :email, :format => { :with =>
> %r\A([^@\s]+)@((?:[-a-z0-9]+.)+[a-z]{2,})\Z/, :on => :create }

%r\A([^@\s]+)@((?:[-a-z0-9]+.)+[a-z]{2,})\Z/
%r\A\Z/
%r/

Maybe use %r!! instead of %r/?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to