最白目
最白目

Reputation: 3644

input data not stored in data base - why?

    //gets the correct User (checked with printlns)
    def user = User.get(params.user?.toString())

    println "usern.nickname " + user.id + " " + user.nickname
    println "user "+user
    /*
     * write in database
     */
        user.nickname = params.nickname
        user.email = params.email

/* a println of user.nickname shows the same as params.nickname, but the database
is not being updated with the value (params.nickname) */

I dont understand this. It´s so simple, but it doesnt update the database. Can anyone help, please give me your vaguest shots, Im thankful for any help

Upvotes: 2

Views: 87

Answers (1)

gotomanners
gotomanners

Reputation: 7926

Silly, but did you forget to save?

If you did, user.save(flush:true) should do the trick.

Upvotes: 6

Related Questions