nathanvda / cocoon

Dynamic nested forms using jQuery made easy; works with formtastic, simple_form or default forms
http://github.com/nathanvda/cocoon
MIT License
3.08k stars 385 forks source link

Link_to_remove_association is not working well #558

Closed Tokinh0 closed 5 years ago

Tokinh0 commented 5 years ago

hi guys I'm working in something with rails, and I using this gem, but how I'm a beginner and such a dum, I don't know if I'm using right.

I have a form for @clients an inside this form I have a partial for the cellphones_fields, my problem is: when I try to remove the first cellphone_fields it removes fine, but I cant remove the cellphone_fields that I add after the first one, I only can remove the first cellphone_field.

the important part of the code is in here > https://gist.github.com/Tokinh0/b312d24168135bd98dac955b9d63fdd3 if I'm missing something please tell me

please forgive my bad english, I'm learning the language too.

Tokinh0 commented 5 years ago

I think i make this work, my problem is that i was using the wrapper class wrong, i had wrapped the class outside the partial so, it din't work , but when a wrapped the class in the partial it work.