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-/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 -~----------~----~----~----~------~----~------~--~---
can you set a debugger in your Controller/Model to see what is actually received? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Try with following validates_inclusion_of :category, :in => %w( X, Y, XY ) validates_length_of :gender, :maximum => 3, :allow_nil => true validates_length_of :tag, :in => 1..10 -- 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 -~----------~----~----~----~------~----~------~--~---
MaD wrote:> can you set a debugger in your Controller/Model to see what is > actually received?How can I se a debbuger?>validates_inclusion_of :category, :in => %w( X, Y, XY ) >validates_length_of :gender, :maximum => 3, :allow_nil => true >validates_length_of :tag, :in => 1..10gender works now, but tag and category nope. -- 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 -~----------~----~----~----~------~----~------~--~---
> How can I se a debbuger? >You need to install ruby-debug gem first Check if it already installed gem list write debugger at the place where u want debugging and now start your server like ./script/server --debugger then you will get debug prompt Type h for help to get available commands example : to print any value say @var p @var -- 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 -~----------~----~----~----~------~----~------~--~---
Fresh Mix wrote:> MaD wrote: >> can you set a debugger in your Controller/Model to see what is >> actually received? > > How can I se a debbuger? > >>validates_inclusion_of :category, :in => %w( X, Y, XY ) >>validates_length_of :gender, :maximum => 3, :allow_nil => true >>validates_length_of :tag, :in => 1..10 > > gender works now, but tag and category nope.For tag also you give validates_length_of :tag, :maximum=>10 like that and try.. you can give minimum also in this.. -- 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 -~----------~----~----~----~------~----~------~--~---