У меня есть форма со следующими вложенными полями, использующими cacoon
I have default fields and a conditional to show more fields if an option is selected ie. Rocket League like so
However, as you can see from the screenshot only one instance of a tournament standing is actually switching fields.
So my question is, how do I make every instance change?
Here is my code:
$(document).on("change", ".ts_select", function(event) {
if (this.value == '1') {
$('#default-fields').hide()
$('#rocket-fields').show()
} else {
$('#default-fields').show()
$('#rocket-fields').hide()
}
})
<% = render partial: "Tournament / fpartials / default", Tournament: @tournament, местные жители: {f: f}%> <% = render partial: "Tournament / fpartials / rocket_league_fields", Tournament: @tournament, locals: {f: f}%>