2008/12/24 sa 125 <[email protected]>

>
> You were right, I had validates_presence_of :name, :vendor_id, :in_stock
> inside my model. Once I removed it I was able to save false values. How
> can I still validate a boolean once I allow a user to enter values (even
> though it'll be either one or the other, using a checkbox or something)?
>
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
Probably you can have something like that:

validates_inclusion_of :in_stock => [true, false]

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to