ドメイン クラスcom.example.users.Userに一時フィールド カルネットを追加しました。
class User implements Serializable {
...
def carnets
static transients = ['springSecurityService', 'carnets']
...
}
私のgsonビューuser/_user.gsonでレンダリングしたい:
import com.example.users.User
model {
User user
}
json g.render(user, [excludes:['password', 'deleted', 'enabled', 'accountExpired', 'accountLocked', 'passwordExpired', 'authorities']]) {
//"carnets" g.render(template:"/carnet/index", collection: user.carnets, var:'carnets')
"carnets" tmpl.'/carnet/index'(user.carnets)
}
しかし、私は受け取った:
原因: grails.views.ViewRenderException: ビューのレンダリング エラー: 名前 /carnet/index のテンプレートが見つかりません
Carnet のビュー gson ファイルは自動生成され、CarnetController から実行すると正常に動作します。
私は何が欠けていますか?