ryanb / nested_form

Rails plugin to conveniently handle multiple models in a single form.
MIT License
1.79k stars 505 forks source link

"removeFields" uses closest `.fields`, which fails without wrapper #326

Closed vendethiel closed 8 years ago

vendethiel commented 10 years ago

I think it'd be a good thing to let it be data-customized, instead of just having :

var field = $link.closest('.fields');
ronakjain90 commented 9 years ago

I'm wondering why isn't there any comments or replies to this issue.

I've tried overriding default behaviour by

window.NestedFormEvents.prototype.removeFields = function(e) {
   //MyCode
};

But this however doesn't work.

vendethiel commented 9 years ago

that worked for me :). At least as far as I can remember.

ronakjain90 commented 9 years ago

It doesn't

window.NestedFormEvents.prototype.insertFields = function(content, assoc, link) {
   //This works.
};

But removeFields doesn't, I'm finding it strange.

window.NestedFormEvents.prototype.removeFields = function(e) {
   //MyCode
};