I might also mention the name of the posted thread we were on.
Homework doubts. Well validation is the problem here. We tried to
validate uniqueness on an already converted string. Of course ruby
thinks it's unique because we failed to convert it before we validate.
I would say go ahead and try some different methods here to see what
happens. They are all there on api docs site.

On Sep 18, 6:56 am, Sidon <[EMAIL PROTECTED]> wrote:
> I solved this with regex:
>
> /(([0-9]{4}[-\s]{0,3}){3}(([0-9]{4}){1}))/
>
> Before save to Database,  "Strip everything but numerics" :-)
>
> Check this regex here:
>
> ___http://cosmoverbal.net
>
> On Sep 14, 8:54 pm, Bryan <[EMAIL PROTECTED]> wrote:
>
> > Can someone explain their thought process on putting the credit card
> > string validation process together?  Conceptually, I understand what
> > is going on, however, I'm not getting the how I would make my custom
> > validation based on:
>
> > "User can enter the credit card format in the following format.  The x
> > has to be numeric value.
> > xxxx-xxxx-xxxx-xxxx  (format #1)
> > xxxx xxxx xxxx xxxx (format #2)
> > xxxxxxxxxxxxxxxx (format #3)"
>
> > I know I would use 
> > validate_format_ofhttp://www.railsbrain.com/api/rails-2.1.0/doc/index.html?a=M001743&na...
>
> > I'm sure this is probably simple for most of you but a push in the
> > right direction will help.
>
> > Thanks!
>
> > b

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "ruby-on-rails-programming-with-passion" group.
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/ruby-on-rails-programming-with-passion?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to