I am having a weird issue with rails 4. I have implemented my view to have the following. Sometimes when I click add a new address, it only adds 1 field. But other times when I click it adds multiple fields. And when it has added multiple fields and clicked to remove the object, it triggers the confirm on the button multiple times. Just wondering if anyone else has experienced this. Have I implemented it wrong, or is it simply a bug in rails 4.
#customer_addresses
= f.fields_for :customer_addresses do |builder|
= render partial: 'customer_addresses', locals: { f: builder }
form-section
.row-fluid
= f.link_to_add "Add a new address", :customer_addresses, :data => { :target => "#customer_addresses" }, class: 'btn btn-success btn-mini', confirm: "Are you sure?"
I am having a weird issue with rails 4. I have implemented my view to have the following. Sometimes when I click add a new address, it only adds 1 field. But other times when I click it adds multiple fields. And when it has added multiple fields and clicked to remove the object, it triggers the confirm on the button multiple times. Just wondering if anyone else has experienced this. Have I implemented it wrong, or is it simply a bug in rails 4.