Master - Detail Form

Hi, I’m new with RoR. I’m trying to do a master-detail CRUD form, using
generate scaffold.
The problem I’m facing is that I have to keep the parent id through the
detail view all the time by hand. Is there any example or way to see how
to do it properly?
Thanks.
Fernando.

PS: For further information, I have a Task and the Tasks have Items, so
when I want to add an Item to a task I have to forward the task id to
the Items edit/add windows, etc, and make shure of not loosing it.