4

I've to render a select when calling a controller function.

class FormController {
    def document() {
        render """<g:select name="tipo" from="${['','one','two']}" />"""
    }
}

it doesn't work.. In the html appear nothing when I replace a div with this function.

4

2 に答える 2

6

代わりに、タグをメソッド呼び出し構文として使用します。

render g.select(name:"tipo" from:['','one','two'])
于 2012-09-21T14:25:51.880 に答える
0
//Build your output string as the next:
def output = g.select(name:"tipo" from:['','one','two'])
//And add any other string or tag if you need
output = "Tipo: " + output
render (text: output)
于 2014-06-19T11:35:41.450 に答える