I''m trying to validate that someone enters an 8 digit number exactly. I''m using the following line but it does not seem to work. Can anyone help? validates_length_of :debt_ref, :is =>8, :message =>"- The debtref can only be 8 digits long" -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 2/12/07, doucie <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I''m trying to validate that someone enters an 8 digit number exactly. > I''m using the following line but it does not seem to work. Can anyone > help? > > validates_length_of :debt_ref, :is =>8, :message =>"- The debtref can > only be 8 digits long" >Your syntax looks right - what is the error that you''re seeing? -- Zack Chandler http://depixelate.com --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Zack Chandler wrote:> On 2/12/07, doucie <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> >> I''m trying to validate that someone enters an 8 digit number exactly. >> I''m using the following line but it does not seem to work. Can anyone >> help? >> >> validates_length_of :debt_ref, :is =>8, :message =>"- The debtref can >> only be 8 digits long" >> > > Your syntax looks right - what is the error that you''re seeing? > > -- > Zack Chandler > http://depixelate.comThere is no error, the model just accepts a number greater than 8 digits! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---