On looking for a solution for a two-domain-classes-in-one-view problem, I ran into the scaffolding tutorial for grails where I saw this:
class BookController {
def scaffold = Book
// overrides scaffolded action to return both authors and books
def list = {
[ "books" : Book.list(), "authors": Author.list() ]
}
}
And it says underneath:
All of this is what is known as "dynamic scaffolding" where the CRUD interface is generated dynamically at runtime.
I'm quite new to the scaffolding concept, and there is something I don't get here. I expect that the list.gsp is dynamically generated based on the controller return parameters, thus enabling me to have both lists in one view. I don't know if this is possible, it's just the thing that I expect to magically happen here. So please, correct me if I'm wrong.
If this should be the case, then something goes wrong in my application and I get:
org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: Tag [paginate] is missing required attribute [total] at /customer/list:45
So this is something in the view, which I don't have, because I'm expecting it to get scaffolded. Could it be that the error is caused by the fact, that I use the default templates? Should I create a new template specially for my needs? Also, is there some aricle on grails lifecycle, so that I can see what gets passed when?
Thank you all for the help, al