我有一个具有一对多关系的域类,如下所示的动态脚手架:
领域:
package mienapp
class Announcements {
String user
String title
String comments
Date dateCreated
static hasMany = [tag: Tags]
static mapping = {
comments sqlType: 'text'
}
static constraints = {
}
}
控制器:
package mienapp
class AnnouncementsController {
def scaffold = true
def index() {
redirect(action: list)
}
}
当控制器重定向到列表时,表格显示公告类中定义的所有字段。我怎样才能显示表格中标签的字段值?