Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grails Render Template Different Controller/Path

Tags:

grails

gsp

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 well. 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?

like image 667
Gregg Avatar asked Jul 01 '10 17:07

Gregg


1 Answers

You do it by controller name:

render(template:'/dashboard/myTemplate')
like image 51
proflux Avatar answered Oct 24 '22 01:10

proflux