In a GSP, one would write
<g:render template="orderDetailsTemplate"
mode:[orderItems:orderItems]/>
The other way however is to decide about the use of a template directly from a Controller:
class OrderController {
def list = {
def orderItems = OrderItem.list( params )
render(temlate:"orderDetailsTemplate"
model:[ orderItems: orderItems])
}
}
A good use-case of using the second way is when an ajax call is made from a GSP page and the result should update a div.
No comments:
Post a Comment