I've got controller AdminTagController
. By default view will be located in /adminTag
folder. Is it possible to change default folder for this controller to /admin/view
? I can specify view for each method but it's not cool
Thank you
It's possible to change it with the afterInterceptor of your controller. Check the example:
def afterInterceptor = { model, modelAndView ->
println "Current view is ${modelAndView.viewName}"
if (model.someVar) {
modelAndView.viewName = "/mycontroller/someotherview"
}
println "View is now ${modelAndView.viewName}"
}
This is applied to all actions of your controller.