# Validation errors

**URL:** <https://www.ruby-forum.com/t/validation-errors/83502>\
**Category:** Rails\
**Created:** [January 26, 2007, 6:22pm UTC](https://www.ruby-forum.com/t/validation-errors/83502 "2007-01-26T18:22:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rvent](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/53a042/32.png) [@rvent](https://www.ruby-forum.com/u/rvent)\
**Post date:** [January 26, 2007, 6:22pm UTC](https://www.ruby-forum.com/t/validation-errors/83502/1 "2007-01-26T18:22:34Z")

</div>

Hello again…

I am trying to validate date input and i am having a few problems… I  
have looked at the api and so far i see nothing wrong with my code…

Model:  
#Validates Length  
validates\_length\_of :part\_number, :minimun =\> 5, :message =\> “Part#  
must be at least 5 digits!”  
validates\_length\_of :work\_order, :minimun =\> 5, :message =\> “Work  
Order must be at least 5 digits!”  
validates\_length\_of :priority, :in =\> 1…3, :message =\> “Priority  
must be between 1 and 3”

EX:  
Part\_number: 12345  
Work\_order: 12345  
priority: 6

This comes back with an error: “private method `split’ called for  
6:Fixnum”

6 is the value entered on the priority field…

When i comment the priority validation out, no matter what value i enter  
on the part\_number and work\_order i get the field highlithed on red.  
Even when the correct value is entered…

Model:  
#Validates Length  
validates\_length\_of :part\_number, :minimun =\> 5, :message =\> “Part#  
must be at least 5 digits!”  
validates\_length\_of :work\_order, :minimun =\> 5, :message =\> “Work  
Order must be at least 5 digits!”  
#validates\_length\_of :priority, :in =\> 1…3, :message =\> “Priority  
must be between 1 and 3”  
EX:  
Part\_number: 12345  
Work\_order: 12345  
priority: 6

Am i missing something…?

Thanks

---

<div class="post-metadata">

**Author:** ![rvent](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/53a042/32.png) [@rvent](https://www.ruby-forum.com/u/rvent)\
**Post date:** [January 26, 2007, 6:48pm UTC](https://www.ruby-forum.com/t/validation-errors/83502/2 "2007-01-26T18:48:56Z")

</div>

I suspect that those validation functions are meant to act on strings.  
Either change to strings or wright a method that validates\_size\_of

---

<div class="post-metadata">

**Author:** ![rvent](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/53a042/32.png) [@rvent](https://www.ruby-forum.com/u/rvent)\
**Post date:** [January 26, 2007, 7:01pm UTC](https://www.ruby-forum.com/t/validation-errors/83502/3 "2007-01-26T19:01:19Z")

</div>

“minimum” is misspelled

---

<div class="post-metadata">

**Author:** ![rvent](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/53a042/32.png) [@rvent](https://www.ruby-forum.com/u/rvent)\
**Post date:** [January 26, 2007, 8:13pm UTC](https://www.ruby-forum.com/t/validation-errors/83502/4 "2007-01-26T20:13:38Z")

</div>

removed\_email\_address@domain.invalid wrote:

> “minimum” is misspelled

Yeah i saw that and corrected it… But i think Keynan is right, i think  
it only works with strings…

---

<div class="post-metadata">

**Author:** ![rvent](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/53a042/32.png) [@rvent](https://www.ruby-forum.com/u/rvent)\
**Post date:** [January 26, 2007, 8:16pm UTC](https://www.ruby-forum.com/t/validation-errors/83502/5 "2007-01-26T20:16:09Z")

</div>

For some reason i cant see the error it reports… It only puts the red  
border around the field with the error… No explanation or no  
message… I followed the tutorial on apple’s site and they only show  
that they put the validation lines and it displayed the whole message  
explaining why it failed…

Any thoughts…?

Thanks
