Forum: Ruby on Rails Child records needing the ID

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Doug (Guest)
on 2006-01-27 01:14

I was hoping someone would be able to help me with a bit of a problem.
So far I've been doing well with my first project.  However, I've come
across a dilemma.

I have a system where I create a record and this then loads a secondary
form (using Ajax) for the entry of the child elements.

For example: I enter details of the "Family" table and click submit at
which point the form for entering the members of that family (the child

However, when submitting the final table I get an error declaring that I
am missing the ID that links to the two tables.  Its complaining because
it hasn't got the parent ID to put into the child to 'link' the two.

How do I insert the ID of the recently created parent record into the
child record?

I'd be very grateful for any advice.

Kind regards

This topic is locked and can not be replied to.