BenR wrote:
> have the following in a partial
> <% OrganisationType.find_all_by_live(true).each do |ot| %>
>   <%= check_box_tag "organisation['organisation_type_ids'][]", ot.id,
> @organisation.have_org_type(ot.id, @organisation.id) %>
>   <%= ot.name %>
> <% end %>
> 
> in the Organisation model I would like to validate that at least one
> of the checkboxes is checked. I am sure this is simple, but, er, I am
> simpler ...
> Any one able to point me in the right direction?
> 
> many thanks
> Ben

If you have just one check box then probably you could have used 
validates_acceptance_of.

Since you have multiple, I think you need to manually loop through 
before save
-- 
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 [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