Validation errors

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

I suspect that those validation functions are meant to act on strings.
Either change to strings or wright a method that validates_size_of

“minimum” is misspelled

[email protected] wrote:

“minimum” is misspelled

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

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