When doing a controller update operation, missing parameters are treated as unchanged. This is a great convention but I'm not sure how to handle this when using a collection_select.
If a user deselects all items in a the HTML select, nothing is sent on the update action. For example, if 2 items are selected I get params[:selected_location_ids] == ["22", "242"] if no items are selected the params[:selected_location_ids] is not sent. Is there a way to make the HTML form send an empty option when nothing is selected so I can know if the user deselected everything vs an alternate form not sending this information? --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---