0
Personal talk,
I have a GROUP_TV table and it relates to the City table through has Many through.
In the _from.html.erb view of GROUP_TV, I have a collection_select to select as many cities as I want. This works perfectly.
The problem happens when I add Chosen’s Gem and configure it to display in that field, it even works, but on the editing page it duplicates, for example:
If in the NEW action I selected the cities: Americana and Barueri and saved, in the EDIT action appear 2 SELECT fields with the same values in each, see the print below:
How can I fix this?
Follow the select code
<%= f.collection_select(:city_ids, City.all, :id, :name, {prompt: "Selecione as cidades"}, {:multiple => true, class: "select-chosen"}) %>
If you put 3 cities, appear 3 selects or only 2?
– Luiz Carvalho