I can't seem to figure out what is wrong with my nested form where on submission it complains that the parent id is missing from from the child record (if I made sense). This is my first time building a nested form and I have been strugging with this for a little over a day.

Basically, I would like to allow the user to upload attachments at the same time they submit a discussion form but can't seem to figure out get the ID in the submission.

The error I get is that the parent can't be blank (the parent id is missing)

I have tried adding a hidden field in the nested form but that didn't seem to work either. I am wondering if anyone can help me understand what I might be doing wrong.

Weird enough, everything seems to work fine if I generate a new application and do just that scenario. Very curious why this doesn't work or what is conflicting with it.

I actually think because I had multiple child records being displayed, if I only uploaded 1 file and left the other one empty that this is why I may have been getting the parent id issue. Adding the bolded seemed to help with that error: