Do clients have a .selected property or some such that you can use to figure
out which clients are already selected? If so you could do, e.g.,
@account.clients.map{|c| !c.selected}
I would think.
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of
Neal L
Sent: Thursday, October 16, 2008 2:10 PM
To: Ruby on Rails: Talk
Subject: [Rails] Removing values from a select (drop-down) box
Hello,
I am working on a project, and on one form we have a select (drop-
down) box where the user needs to be able to select from a list of clients.
The box is currently being populated with:
<%= collection_select(:client, :id, @account.clients, :id, :name) %>
The problem is that some of these clients may have already been selected, and
we need to remove them from the list. Is this possible?
Thanks!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---