I was wondering: shouldn''t email and url validators be in ActiveModel? I cannot remember a project where I didn''t have to deal with email fields. They''re 100% generic too. I am willing to make a patch, but I''d thought I''d consult here first. If so, how should we do it? Via a regex, or via the mail gem[1] ? [1] http://my.rails-royce.org/2010/07/21/email-validation-in-ruby-on-rails-without-regexp/ -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
+1. E-mails and URLs are basic and universal. -- LAILSON BANDEIRA http://lailsonbandeira.com/ On Sat, Feb 5, 2011 at 8:30 AM, iain <iain@iain.nl> wrote:> I was wondering: shouldn''t email and url validators be in ActiveModel? > I cannot remember a project where I didn''t have to deal with email > fields. > > They''re 100% generic too. > > I am willing to make a patch, but I''d thought I''d consult here first. > > If so, how should we do it? Via a regex, or via the mail gem[1] ? > > > [1] > http://my.rails-royce.org/2010/07/21/email-validation-in-ruby-on-rails-without-regexp/ > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
With the new validator, I don''t think that this is necessary. I guess that''s why the introduction of the new validator. On Sun, Feb 6, 2011 at 6:54 PM, Lailson Bandeira <lailsonbm@gmail.com> wrote:> +1. E-mails and URLs are basic and universal. > -- > LAILSON BANDEIRA > http://lailsonbandeira.com/ > > > On Sat, Feb 5, 2011 at 8:30 AM, iain <iain@iain.nl> wrote: >> >> I was wondering: shouldn''t email and url validators be in ActiveModel? >> I cannot remember a project where I didn''t have to deal with email >> fields. >> >> They''re 100% generic too. >> >> I am willing to make a patch, but I''d thought I''d consult here first. >> >> If so, how should we do it? Via a regex, or via the mail gem[1] ? >> >> >> [1] >> http://my.rails-royce.org/2010/07/21/email-validation-in-ruby-on-rails-without-regexp/ >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Core" group. >> To post to this group, send email to rubyonrails-core@googlegroups.com. >> To unsubscribe from this group, send email to >> rubyonrails-core+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-core?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
I think making this a gem first would be a good start, and once its garnered major support then it will be merged into core. Not all applications have to validate email and URLs (although, a large majority do, I will concede) -- Ryan Bigg On Saturday, 5 February 2011 at 10:30 PM, iain wrote:> I was wondering: shouldn''t email and url validators be in ActiveModel? > I cannot remember a project where I didn''t have to deal with email > fields. > > They''re 100% generic too. > > I am willing to make a patch, but I''d thought I''d consult here first. > > If so, how should we do it? Via a regex, or via the mail gem[1] ? > > > [1] http://my.rails-royce.org/2010/07/21/email-validation-in-ruby-on-rails-without-regexp/ > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
I''d be glad to help as I''ve already created (with other people) ActiveValidators <https://github.com/cesario/activevalidators>. FYI Iain, the email validation is based on the mail gem. Franck On Mon, Feb 7, 2011 at 6:32 AM, Ryan Bigg <radarlistener@gmail.com> wrote:> I think making this a gem first would be a good start, and once its > garnered major support then it will be merged into core. Not all > applications have to validate email and URLs (although, a large majority do, > I will concede) > > -- > Ryan Bigg > > On Saturday, 5 February 2011 at 10:30 PM, iain wrote: > > I was wondering: shouldn''t email and url validators be in ActiveModel? > I cannot remember a project where I didn''t have to deal with email > fields. > > They''re 100% generic too. > > I am willing to make a patch, but I''d thought I''d consult here first. > > If so, how should we do it? Via a regex, or via the mail gem[1] ? > > > [1] > http://my.rails-royce.org/2010/07/21/email-validation-in-ruby-on-rails-without-regexp/ > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
On Mon, Feb 07, 2011 at 04:32:02PM +1100, Ryan Bigg wrote:> I think making this a gem first would be a good start, and once its garnered major support then it will be merged into core. Not all applications have to validate email and URLs (although, a large majority do, I will concede)I agree with this. A gem first would be a good start. One problem is that pretty much every place I''ve worked has had different rules for validating emails and urls. Some places are fine by using the RFC, some places want their own specific business rules, etc. I''d rather not have these types of validations in core as I''ve never worked at two places that had the same validation rules. -- Aaron Patterson http://tenderlovemaking.com/
Nikos Dimitrakopoulos
2011-Feb-08 06:01 UTC
Re: Re: Email and URL validators in ActiveModel
I must say I agree. A good, stable and full featured gem is what''s needed. The only downside to this is that newcomers to the framework won''t know it and thus have to re-implement the wheel again and again, at least in their first steps. Could the gem be officially supported, possibly with a reference in the documentation? On Tuesday, February 8, 2011 3:11:04 AM UTC+2, Aaron Patterson wrote:> > On Mon, Feb 07, 2011 at 04:32:02PM +1100, Ryan Bigg wrote: > > I think making this a gem first would be a good start, and once its > garnered major support then it will be merged into core. Not all > applications have to validate email and URLs (although, a large majority do, > I will concede) > > I agree with this. A gem first would be a good start. > > One problem is that pretty much every place I''ve worked has had different > rules for validating emails and urls. Some places are fine by using the > RFC, some places want their own specific business rules, etc. > > I''d rather not have these types of validations in core as I''ve never > worked at two places that had the same validation rules. > > -- > Aaron Patterson > http://tenderlovemaking.com/ > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
On Tue, Feb 8, 2011 at 12:11 PM, Aaron Patterson <aaron@tenderlovemaking.com> wrote:> > I''d rather not have these types of validations in core as I''ve never > worked at two places that had the same validation rules.Quite by coincidence, the same is true for validates_numericality_of. Maybe we should pull that out to a gem too. TX -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Weird, I''ve never worked on any project that had a numericality requirement not met by vno. On Wed, Feb 9, 2011 at 2:45 PM, Trejkaz <trejkaz@trypticon.org> wrote:> On Tue, Feb 8, 2011 at 12:11 PM, Aaron Patterson > <aaron@tenderlovemaking.com> wrote: > > > > I''d rather not have these types of validations in core as I''ve never > > worked at two places that had the same validation rules. > > Quite by coincidence, the same is true for validates_numericality_of. > Maybe we should pull that out to a gem too. > > TX > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
On Thu, Feb 10, 2011 at 10:22 AM, Jason King <jk@handle.it> wrote:> Weird, I''ve never worked on any project that had a numericality requirement > not met by vno.You must have mis-read. I said that validates_numericality_of also exhibited this: | I''ve never worked at two places that had the same validation rules. To illustrate: { :greater_than => 2 } Is a different validation rule to { :less_than => 10 } But nonetheless, the *core* of the matter is that the format for "a number" does not change - the subset of values you permit does. In the same way, { :domain_in => /\.edu\./ } Would be a different validation rule to { :domain_in => /\.jp$/ } But nonetheless, the *core* of the matter is that the format for "an email address" does not change - the subset of values you permit does. I hope you can see the parallels. TX -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
On Thu, Feb 10, 2011 at 10:51 PM, Trejkaz <trejkaz@trypticon.org> wrote:> In the same way, > > { :domain_in => /\.edu\./ } > > Would be a different validation rule to > > { :domain_in => /\.jp$/ }Well, OK, the format of a standalone domain name is mostly considered the same.> But nonetheless, the *core* of the matter is that the format for "an > email address" does not change - the subset of values you permit does.The format for an email is not, as was written earlier in this thread.There are email addresses that are not conformant to all related RFCs but perfectly usable at least in the context of a certain deployment. OTOH there are more or less esoteric RFC conformant email address formats that are not much used or no longer supported by all current mailservers and not desirable in some applications. Examples: * addresses with IPv4 address literals * addresses with not fully qualified domains that are completed by the mail submission agent * addresses with internationalized domain names, maybe stored before punycode conversion ... Similar cases can be made for URLs. So yes, the fomat of email addresses and URLs may be quite different in different applications. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Rodrigo Rosenfeld Rosas
2011-Feb-11 18:38 UTC
Re: Re: Email and URL validators in ActiveModel
Em 11-02-2011 15:20, Rainer Frey escreveu:> ... > > Similar cases can be made for URLs. > > So yes, the fomat of email addresses and URLs may be quite different > in different applications.That doesn''t mean that a gem should come first. DDH became famous among other things for his "opinated software" policy. By the way, I''ve been enjoyed a lot his recent book "Rework", although I''ve not finished it yet. Highly recommended. As well as José Valim''s excellent book "Crafting Rails Application". Back to the subject, after the free merchandise, what I''m saying is that this is a very common requirement and most developers don''t (shouldn''t?) care that much about e-mail format. At least for 90% of the applications. So, I don''t see any reasons why not to include some "validates_email_of" helper. It doesn''t need to solve all cases. It can have some options for specifying some regular expression or some lambda for verifying the e-mail format in case someone is really worried about it. It can even be customized in a global configuration per project/engine/mountable application. There could be some pre-defined options specified by symbol like :rfc_compliant, :performant_verification, etc. I just don''t buy the idea to make this more difficult than it should be. It is much simpler to evolute and understand better the validations after they are provided on rails core distribution. Also, in the beginning, there were lots of philosophies about Rails, like the 80/20 principle. No body talks about this anymore... In every web application with a user sign up feature, there will be an e-mail validation. This is probably over 90% of the web applications built with Rails. Even so, this will require all of these developers to replicate the logic to validate e-mail. Most of them will just extract this one from Rails documentation: validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i That is because, this is usually the first thing written in a new application that requires a user to log in. In this stage, no one is willing to invest any time on the e-mail validation rule. Usually this will only happen if some customer complaint about not being able to register himself because the system is rejecting his e-mail. For my applications, I usually don''t care very much about the format because of the way I handle the registration part. The user doesn''t input any information in the register form, except his e-mail address. Then, he is informed that there were sent instructions for continuing the register process to his e-mail and he''ll continue to register following a link on the e-mail. That way I can know for sure that the e-mail is valid. So, I think that even if not perfect, Rails should not wait for any gem before supporting e-mail and URL validations built-in, even though I have a feeling that it won''t happen based on what I''ve being observed from the core-team point of view. Best regards, Rodrigo. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
+1 Both to including validates_as_email in core and that that regex is a joke. Ben On 2/11/11 10:38 AM, Rodrigo Rosenfeld Rosas wrote:> Em 11-02-2011 15:20, Rainer Frey escreveu: >> ... >> >> Similar cases can be made for URLs. >> >> So yes, the fomat of email addresses and URLs may be quite different >> in different applications. > > That doesn''t mean that a gem should come first. DDH became famous among > other things for his "opinated software" policy. By the way, I''ve been > enjoyed a lot his recent book "Rework", although I''ve not finished it > yet. Highly recommended. As well as José Valim''s excellent book > "Crafting Rails Application". > > Back to the subject, after the free merchandise, what I''m saying is that > this is a very common requirement and most developers don''t (shouldn''t?) > care that much about e-mail format. At least for 90% of the > applications. So, I don''t see any reasons why not to include some > "validates_email_of" helper. It doesn''t need to solve all cases. It can > have some options for specifying some regular expression or some lambda > for verifying the e-mail format in case someone is really worried about > it. It can even be customized in a global configuration per > project/engine/mountable application. There could be some pre-defined > options specified by symbol like :rfc_compliant, > :performant_verification, etc. > > I just don''t buy the idea to make this more difficult than it should be. > It is much simpler to evolute and understand better the validations > after they are provided on rails core distribution. Also, in the > beginning, there were lots of philosophies about Rails, like the 80/20 > principle. No body talks about this anymore... In every web application > with a user sign up feature, there will be an e-mail validation. This is > probably over 90% of the web applications built with Rails. Even so, > this will require all of these developers to replicate the logic to > validate e-mail. Most of them will just extract this one from Rails > documentation: > > validates_format_of :email, :with => > /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i > > That is because, this is usually the first thing written in a new > application that requires a user to log in. In this stage, no one is > willing to invest any time on the e-mail validation rule. Usually this > will only happen if some customer complaint about not being able to > register himself because the system is rejecting his e-mail. > > For my applications, I usually don''t care very much about the format > because of the way I handle the registration part. The user doesn''t > input any information in the register form, except his e-mail address. > Then, he is informed that there were sent instructions for continuing > the register process to his e-mail and he''ll continue to register > following a link on the e-mail. That way I can know for sure that the > e-mail is valid. > > So, I think that even if not perfect, Rails should not wait for any gem > before supporting e-mail and URL validations built-in, even though I > have a feeling that it won''t happen based on what I''ve being observed > from the core-team point of view. > > Best regards, > > Rodrigo. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
That''s it. I completely agree with Rodrigo. -- LAILSON BANDEIRA http://lailsonbandeira.com/ On Fri, Feb 11, 2011 at 5:24 PM, Ben Munat <bmunat@gmail.com> wrote:> +1 Both to including validates_as_email in core and that that regex is a > joke. > > Ben > > > On 2/11/11 10:38 AM, Rodrigo Rosenfeld Rosas wrote: > >> Em 11-02-2011 15:20, Rainer Frey escreveu: >> >>> ... >>> >>> Similar cases can be made for URLs. >>> >>> So yes, the fomat of email addresses and URLs may be quite different >>> in different applications. >>> >> >> That doesn''t mean that a gem should come first. DDH became famous among >> other things for his "opinated software" policy. By the way, I''ve been >> enjoyed a lot his recent book "Rework", although I''ve not finished it >> yet. Highly recommended. As well as José Valim''s excellent book >> "Crafting Rails Application". >> >> Back to the subject, after the free merchandise, what I''m saying is that >> this is a very common requirement and most developers don''t (shouldn''t?) >> care that much about e-mail format. At least for 90% of the >> applications. So, I don''t see any reasons why not to include some >> "validates_email_of" helper. It doesn''t need to solve all cases. It can >> have some options for specifying some regular expression or some lambda >> for verifying the e-mail format in case someone is really worried about >> it. It can even be customized in a global configuration per >> project/engine/mountable application. There could be some pre-defined >> options specified by symbol like :rfc_compliant, >> :performant_verification, etc. >> >> I just don''t buy the idea to make this more difficult than it should be. >> It is much simpler to evolute and understand better the validations >> after they are provided on rails core distribution. Also, in the >> beginning, there were lots of philosophies about Rails, like the 80/20 >> principle. No body talks about this anymore... In every web application >> with a user sign up feature, there will be an e-mail validation. This is >> probably over 90% of the web applications built with Rails. Even so, >> this will require all of these developers to replicate the logic to >> validate e-mail. Most of them will just extract this one from Rails >> documentation: >> >> validates_format_of :email, :with => >> /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i >> >> That is because, this is usually the first thing written in a new >> application that requires a user to log in. In this stage, no one is >> willing to invest any time on the e-mail validation rule. Usually this >> will only happen if some customer complaint about not being able to >> register himself because the system is rejecting his e-mail. >> >> For my applications, I usually don''t care very much about the format >> because of the way I handle the registration part. The user doesn''t >> input any information in the register form, except his e-mail address. >> Then, he is informed that there were sent instructions for continuing >> the register process to his e-mail and he''ll continue to register >> following a link on the e-mail. That way I can know for sure that the >> e-mail is valid. >> >> So, I think that even if not perfect, Rails should not wait for any gem >> before supporting e-mail and URL validations built-in, even though I >> have a feeling that it won''t happen based on what I''ve being observed >> from the core-team point of view. >> >> Best regards, >> >> Rodrigo. >> >> > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Well said, Rodriguo. I''m convinced. Opinionated framework for the win. +1 for built-in URL and email validators. Brian On Feb 11, 4:01 pm, Lailson Bandeira <lail...@guava.com.br> wrote:> That''s it. I completely agree with Rodrigo. > -- > LAILSON BANDEIRAhttp://lailsonbandeira.com/ > > On Fri, Feb 11, 2011 at 5:24 PM, Ben Munat <bmu...@gmail.com> wrote: > > +1 Both to including validates_as_email in core and that that regex is a > > joke. > > > Ben > > > On 2/11/11 10:38 AM, Rodrigo Rosenfeld Rosas wrote: > > >> Em 11-02-2011 15:20, Rainer Frey escreveu: > > >>> ... > > >>> Similar cases can be made for URLs. > > >>> So yes, the fomat of email addresses and URLs may be quite different > >>> in different applications. > > >> That doesn''t mean that a gem should come first. DDH became famous among > >> other things for his "opinated software" policy. By the way, I''ve been > >> enjoyed a lot his recent book "Rework", although I''ve not finished it > >> yet. Highly recommended. As well as José Valim''s excellent book > >> "Crafting Rails Application". > > >> Back to the subject, after the free merchandise, what I''m saying is that > >> this is a very common requirement and most developers don''t (shouldn''t?) > >> care that much about e-mail format. At least for 90% of the > >> applications. So, I don''t see any reasons why not to include some > >> "validates_email_of" helper. It doesn''t need to solve all cases. It can > >> have some options for specifying some regular expression or some lambda > >> for verifying the e-mail format in case someone is really worried about > >> it. It can even be customized in a global configuration per > >> project/engine/mountable application. There could be some pre-defined > >> options specified by symbol like :rfc_compliant, > >> :performant_verification, etc. > > >> I just don''t buy the idea to make this more difficult than it should be. > >> It is much simpler to evolute and understand better the validations > >> after they are provided on rails core distribution. Also, in the > >> beginning, there were lots of philosophies about Rails, like the 80/20 > >> principle. No body talks about this anymore... In every web application > >> with a user sign up feature, there will be an e-mail validation. This is > >> probably over 90% of the web applications built with Rails. Even so, > >> this will require all of these developers to replicate the logic to > >> validate e-mail. Most of them will just extract this one from Rails > >> documentation: > > >> validates_format_of :email, :with => > >> /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i > > >> That is because, this is usually the first thing written in a new > >> application that requires a user to log in. In this stage, no one is > >> willing to invest any time on the e-mail validation rule. Usually this > >> will only happen if some customer complaint about not being able to > >> register himself because the system is rejecting his e-mail. > > >> For my applications, I usually don''t care very much about the format > >> because of the way I handle the registration part. The user doesn''t > >> input any information in the register form, except his e-mail address. > >> Then, he is informed that there were sent instructions for continuing > >> the register process to his e-mail and he''ll continue to register > >> following a link on the e-mail. That way I can know for sure that the > >> e-mail is valid. > > >> So, I think that even if not perfect, Rails should not wait for any gem > >> before supporting e-mail and URL validations built-in, even though I > >> have a feeling that it won''t happen based on what I''ve being observed > >> from the core-team point of view. > > >> Best regards, > > >> Rodrigo. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Core" group. > > To post to this group, send email to rubyonrails-core@googlegroups.com. > > To unsubscribe from this group, send email to > > rubyonrails-core+unsubscribe@googlegroups.com. > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-core?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
On Fri, Feb 11, 2011 at 7:38 PM, Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com> wrote:> validates_format_of :email, :with => > /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/iThat''s an unfortunate example, will replace it with something else. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
+1 for URL and email validators. Allen Madsen http://www.allenmadsen.com On Sat, Feb 12, 2011 at 4:19 AM, Xavier Noria <fxn@hashref.com> wrote:> On Fri, Feb 11, 2011 at 7:38 PM, Rodrigo Rosenfeld Rosas > <rr.rosas@gmail.com> wrote: > > > validates_format_of :email, :with => > > /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i > > That''s an unfortunate example, will replace it with something else. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.