我在Grails的基於Web的應用程序四個疇班(第一我已經做過):如何在Grails的一個視圖中將數據插入到四個表中?
class Receipt
{
String title
Date dateCreated
static hasMany = [articles: Article]
static constraints =
{
title blank: false, unique: true
}
}
class Article
{
String name
Quantity quantity
TypeOfArticle typeOfArticle
static hasOne = [quantity:Quantity, typeOfArticle:TypeOfArticle]
static constraints =
{
quantity unique: true
}
}
class Quantity
{
Integer quantity
Article article
}
class TypeOfArticle
{
String type
Article article
}
我怎樣才能加在一起一個收據上一個視圖中的所有細節?
我想使它看起來像這樣的畫面: http://i.stack.imgur.com/uNVzW.png
我希望你能幫幫我!先謝謝你!
您知道什麼是GSP? http://grails.org/doc/latest/guide/theWebLayer.html#gsp –
有關標準示例,請參閱grails文檔。基本的控制器和服務應該幫助你做到這一點。 –