2013-07-31 41 views
4

假設下(簡體)域類:的Grails:腳手架創建視圖與的hasMany關係域

class Person { 

    static hasMany = [stringProperties: StringProperty] 

    static constraints = { 
    } 

} 

class StringProperty { 

    String name 
    String value 

    static constraints = { 
     name blank:false 
     value blank: true 
    } 

} 

當腳手架生成創建視圖,有中沒有選項gsp從Person創建一個StringProperty。

插件是否存在或者是否有人知道最佳實踐,它可以呈現一種允許創建hasmany關係的成員的創建UI。

我只是問在我花時間修改腳手架模板之前。

回答

0

這是社區歡迎插件或增強腳手架的領域之一。如果我有時間,我會採取信息presented here併爲它做一個插件。我已經使用了這種方法幾次,它運作良好。