ryanb/nested_form — pull request #339 by ayaman (2014-09-18 09:11:20+00:00)
Title: Add the generated ID as a data attribute to the new field

I'm using EJS to add new nested fields to the page after making an AJAX request to the server. The issue is that with multi-level nesting, this can get quite messy since there's no easy way to find the parent ID except with a regexp.

A simple solution would be to add a data attribute to each newly added field that contains the randomly generated ID assigned to the field, which can then be used by any JS functions that need it.