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

TypeError: $(...).data(...) is undefined #562

Closed chrisgeek closed 5 years ago

chrisgeek commented 5 years ago

This is a really nice gem, but i am trying to integrate with active admin, after setting up and adding the cocoon gem along with the helper methods, i get the error message in the console when i click on add button
TypeError: $(...).data(...)is undefinedhas_many.self446c9b9bd27b1aa5d290e05d59bdd0ae4eee5141028d015114f42dc7536391d9.js:50:26 Rails version: 5.1.2 cocoon: 1.2.14

chrisgeek commented 5 years ago

I needed to add #= require cocoon to the active_admin.js and not application.js