Reputation: 43
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.
Upvotes: 4
Views: 1614
Reputation: 4980
//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)
Upvotes: 0
Reputation: 122364
Use the tag as method call syntax instead:
render g.select(name:"tipo" from:['','one','two'])
Upvotes: 6