I want to return my response as JSON with ajax containing more atributtes instead only the template:
Defa开发者_如何学Goult:
render(template:"/templates/question",model:[question: question])
..and want something like:
def template = *get*(template:"/templates/question",model:[question: question])
render [template:template, isTemplate: true] as JSON
Is that possible? Thanks
Then the solution is:
class MyController {
def test = {
// stored as string ...
def x = g.render(template:"/basecontroller/test",model:[name:"wysmedia.com"]);
render(x); // display the template instead render
}
}
精彩评论