Domain has a 1:M mapping: e.g. Person has many Phones.
When generating view, controller, etc. with grails generate-all The edit.gsp pages have an incorrect link tag in them for the 1 side (i.e. Person).
I've attached a test case that shows the problem and I know how to manually fix it. I just couldn't track down where the problem was occurring.
To recreate the problem, Bring up the person list (there are two people Brian and Test loaded) and choose Test. Edit Test and choose Add Phone. You'll notice that the phone has Brian selected in the drop down. It's not passing Test's id over as part of the request even though it's trying to.
Here's the code it generated:
<g:link controller="phone" params="["person.id":person?.id]" action="create">Add Phone</g:link>
if you change the double quotes around person.id to single quotes. It works AOK.
like this:
<g:link controller="phone" params="["person.id":person?.id]" action="create">Add Phone</g:link>
I hope this makes sense.