Render Grails tag in controller

I have to display the selection when the controller function is called.

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

he does not work. Nothing appears in html when I replace a div with this function.

+4
source share
2 answers

Instead, use the tag as a call method :

 render g.select(name:"tipo" from:['','one','two']) 
+6
source
 //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) 
0
source

Source: https://habr.com/ru/post/1435510/


All Articles