gpt4 book ai didi

grails - 在 Controller 中渲染 Grails 标签

转载 作者:行者123 更新时间:2023-12-05 00:33:08 27 4
gpt4 key购买 nike

我必须在调用 Controller 函数时呈现一个选择。

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

它不起作用.. 当我用这个函数替换一个 div 时,在 html 中什么也没有出现。

最佳答案

使用 tag as method call语法代替:

render g.select(name:"tipo" from:['','one','two'])

关于grails - 在 Controller 中渲染 Grails 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12532202/

27 4 0