I have a project that’s running on version 2 and i’m struggling to refresh a field in the relation widget manage form, after saving a form in a third popup. I’ll try and explain.
I have 3 models.
Company
hasMany: Contacts, Deals
Contact
belongsTo: Company
hasMany: Deals
Deal
belongsTo: Company, Contact
On the company preview page, i’m using relationRender(‘deals’) which shows me a create deal button and a list of the company’s deals.
When clicking the Create Deal button, the deal form defined in Companies controller config_relation is showing in a modal and this is all working great, as expected.
One of the fields on the deal form is a partial, where I have a button to Create a contact. When pressed, a second modal is shown displaying the create contact form. I have this form working and I’m able to create a contact and have it be assigned to the original company that the user is previewing.
The bit i’m struggling with is populating the deal’s contact field in the manage relation form with the newly created contact.
From the Companies controller, I’m not sure how I can render the company’s deal’s contact form field.
Hope all that makes sense, appreciate any help on this.