Topic: How to update fields after collection_select :onchange
I have a page with multiple identical collection_select boxes. When an item is selected in a particular box, I would like to update the fields relevant to that dropdown box, but not the equivalent fields for the other collection_select boxes. As an example, if Amplifiers have a "wattage" property, I would like to update the wattage field for each amplifier after it's chosen from a dropdown without accidentally updating the wattage fields for other amplifiers.
The most basic way I can think of would be to uniquely label each amplifier wattage field upon creation, then store this and update only this field in the :onchange code. Is there an easier way to do this?
I currently have a partial that creates the form for each amplifier (dropdown plus associated fields).