For testing purpose you can load some data into the bootstrap:
class BootStrap {
def init = { servletContext ->
def writer = new Author(name:"Jane")
writer.save()
if(writer.hasErrors()){
println writer.errors
}
def comic = new Book(name: "superman", Author: writer)
comic.save()
if(comic.hasErrors()){
println comic.errors
}
}
def destroy = {}
}This way your app will have an Author and a Book in it.
Also this tutorial helped me very much.
No comments:
Post a Comment