开发者

Grails Render Template Different Controller/Path

开发者 https://www.devze.com 2023-01-05 15:35 出处:网络
I have a template that exists under views/dashboard/_myTemplate.gsp and from the DashboardController I can simply call

I have a template that exists under views/dashboard/_myTemplate.gsp and from the DashboardController I can simply call

render template:'myTemplate'

and all is we开发者_如何转开发ll. I have a need to render this template from a different controller but the render method doesn't allow you to specify a controller and I can't seem to figure out how to define the path at which the template exists for the render to work correctly. Is this even possible?


You do it by controller name:

render(template:'/dashboard/myTemplate')
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号