Leonardo
Leonardo

Reputation: 1

Grails 3.2.8 - Taglib ˜g not acessible from controller

Im trying to use the following command on a controller:

String html = g.render(template: 'etiqueta', model: [user: user])

It works perfectly on another project of mine, using Grails 3.3.1. But on Grails 3.2.8 it doens't work! I'm trying to find a workaround without success.

I just started on a new job and I got stuck on this task because of this issue, it`s been a couple days now...

Does anyone know to solve this?

Upvotes: 0

Views: 57

Answers (1)

Jeff Scott Brown
Jeff Scott Brown

Reputation: 27220

You can use a PageRenderer.

class SomeController {

    PageRenderer groovyPageRenderer

    def someAction() {
        def html = groovyPageRenderer.render(template: 'etiqueta', model: [user: user])
        // ...
    }
}

Upvotes: 1

Related Questions