【发布时间】:2015-04-30 10:55:26
【问题描述】:
假设我有控制器 Author 和 Book 像这样:
class Author{
def show(Integer authorId){
//code
render view:'show',model:[author:author]
}
}
class Book{
def list(Integer authorId){
//code
render view:'list', model:[books:books]
}
}
现在,当渲染作者的显示页面时,我想显示作者写的书籍列表,我想通过传递 authorId 调用 Book 的控制器列表操作来实现。
有可能吗?如果是怎么办?
【问题讨论】: