I have a list that is enclosed in a form. Each item in the list has a
checkbox, so an excerted bit of the code is (the part to list the
contacts is really in a partial):
<% form_tag fxn_for_selected_contacts_path, :method => :put do %>
...
<%= for contact in @contacts do %>
<%= check_box_tag('contact_ids[]', contact.id, false, :class =>
'selector') %>
<%= contact.name %>
<% end %>
...
<% end %>
The form also has a select menu that is used to list a set of 'groups'
that the selected items can be added to. I'd like to add the selected
items to the selected group either using an :onchange handler or
observe_field when the user changes the menu selection.
At the moment I'm calling a remote_function like so:
:onchange => remote_function(:url => {:action
=> :add_to_group}, :with => "'value=' + value")
this works well to pass the selected group in params[:value]
My problem is that because I'm calling remote_function, I dont get the
contact_ids[] passed back, so I dont know what the selections are in
the add_to_group action.
Any thoughts on how to determine which checkboxes are selected and
pass them to this remote function?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---