Reputation: 797
I'm trying to add an item with the Cocoon gem programmatically. I used this:
$("a.add_fields").click();
And it does work. I'm wondering if there is a more elegant solution. This seems a bit like a hack.
Upvotes: 2
Views: 141
Reputation: 50057
No. At the moment that is the only way. The code would have to be refactored for this to work, and all configuration is in the link anyway (which association, which partial, how to build, ...), so I think it is not too bad at the moment.
Upvotes: 2