开发者

Grails. Domain class. Method AddTo*?

I have this example:

def mycreate = {

    def id = params.id;
    def data = JSON.parse(params.data);

    def credit = Credit.get(id);

    def front = new Front ();
    front.properties = data;

    credit.addToFronts(front).save()

    render (front as JSON)
}

This action returns something like this:

{"class":开发者_如何学编程"test.Front","id":null,"credits":{"class":"Credit","id":1},"dateCreated":null,"description":"write text here."}

But, for me, the params "id" and "dateCreated" are null. How can I get the values of these params?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜