Reputation: 4278
I want to return my response as JSON with ajax containing more atributtes instead only the template:
Default:
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
Upvotes: 1
Views: 428
Reputation: 4278
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
}
}
Upvotes: 1