ryanb / nested_form

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

fields_blueprint_id_for takes root object into account #300

Open panupan opened 10 years ago

panupan commented 10 years ago

This fixes link_to_add when we have two nested forms on a page with different objects and they have overlapping associations. An example being Issue.attachments and Comment.attachments.

nunosilva800 commented 10 years ago

@panupan @ryanb @lest I encountered a similar problem and I made this fix: https://github.com/Onumis/nested_form/compare/ryanb:master...master It seems more simple and it relies on the fact that the blueprint is placed inside of the form (as a first child).

If you want I can create a PR on this (note that I've only updated the jQuery javascript).