Validation:
  validates_presence_of :name
 validates_length_of :name, :maximum => 150
  validates_inclusion_of :category, :in => %w( X  Y XY )
  validates_length_of :gender, :maximum => 3
  validates_length_of :tag, :within => 1..10

Data sended

data: !map:HashWithIndifferentAccess
  name: Bond
  category: X
  tag: standard

Errors:

Category is not included in the list
Tag is too short (minimum is 1 characters)
Gender is too long (maximum is 3 characters)

What wrong?

Category is in list
Tag can't be too short, it 8 char
And gender can't be too long, because there is no gender value at all.
-- 
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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to