I've returned to Grails after a number of years, and find the productivity better than ever, but hit a bit of a roadblock in the Fields plugin and "respond" method. I created a domain class with a hasMany but do not wish the index view to be cluttered with the links to those children. I could eliminate that column by placing the _table.gsp template and modifying it, but then that applies globally which I don't want.
My next attempt was to invoke "list" on the domain object within the controller and "collect" only the columns I want. When I pass this result to "respond", the view is empty, but has no errors.
Digging a bit further I find that "respond" expects a PagedResultList which I gather is a thin wrapper around a List. But my step above returns an ArrayList. I can't see how to construct a PagedResultList and passing the ArrayList to "respond" quietly does nothing.
I finally got the desired appearance by kind of going backwards, using "render" and an older-style hand-built view, but that seems to defeat the purpose of the simple elegance of "respond" and the Fields plugin.
Am I missing something simple?
If you're happy generating the views for your domain you can modify index.gsp and specify the properties like:
<f:table collection="${authorList}" properties="['name', 'city', 'dob']" />
You could also use 'except' to specify fields to skip, docs here