I have controllers for two models between which there exists a
How do I reference the parent model object in the child controller so
that I can later recover the child object in the parent controller,
i.e., create and “attach” the child to the parent model for later
I would have guessed it was something like as follows:
@parent = ParentModel.find(params[:id]) # How to get “current”
parent from database?
@parent.child = ChildModel.new(params[:child])