I have an array of attributes that I use for select menus, and thus
validations on those fields when theyre updated.
in my view i have something like:
<% select ''thing'', ''stuff'',
Thing.stuff_options, :allow_blank => true %>
and in my validations
validates_inclusion_of :stuff, :in => STUFF, :allow_nil => true
The problem being that blank != nil so the validation fails if the user
picks the ''blank'' select option.
--
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
-~----------~----~----~----~------~----~------~--~---