I am struggling with this right now, I am in chapter 7 “Forum Messages and UI Tricks” there is a bunch of code to create the message threaded forums. I have worked my way through this and it doesn’t work. Nor can I understand how it could have worked. My problem is this bit
It should create a link with a parameter of “?eventId=n” which it does do but if I look in the list code that was generated by grails I see.
Which should generate a link with a parameter of “?event.id=n” which it does. When I use the code from the book the “create” method does not work because an event was not created. BUT if I replace that one line with event.id and it works.
I looked at the sample code and they all follow the eventId prototype but I just tried the code in forum.1 and it did not work on my machine either so I am not sure if I missed something, my env isn’t working or if this just didn’t work? I don’t understand how eventId would have ever worked to be honest but one thing I notice about Grails is that there is a healthy dose of “magic” which makes me think I am missing something somewhere.
Now I will say that I LIKE the look of eventId vs event.id in the url and how would one go about making that work? I guess I could just extract the parameter in the create method and then create event.id parameter in the params object and pass that in.