I am using cocoon, and have the following callback:
$(document).bind('cocoon:after-insert', function(e,inserted_item) {
alert('Inserted!');
});
The alert fires as expected, but inserted_item
is undefined. e
is fully formed and available. What am I missing?
I have also attempted to replace document
with a class selector, but there is no change.
Are you using the gem from github? E.g. in your gemfile write:
gem 'cocoon', :git => 'https://github.com/nathanvda/cocoon'
The feature you mention is not yet released, will happen somewhere this weekend. Want to fix one other open issue first.