M
mitteg
Guest
Hello,
I have a model like this:
class News{
String title
String content
String author
}
When I generate the controller and the view (grails generate-all News) then I have a working CRUD (Create, Read, Update and Delete). So far so good.
But I would like the "author" field to be filled in automatically from the logged in user. The username is accessible doing something like <sec: username> which retrieves the logged-in user from the CAS.
So, I would like to not have the "author" field in the create.gsp scaffolded view. Very much in the same way that dateCreated and lastUpdated get filled automatically.
Thank you very much!
I have a model like this:
class News{
String title
String content
String author
}
When I generate the controller and the view (grails generate-all News) then I have a working CRUD (Create, Read, Update and Delete). So far so good.
But I would like the "author" field to be filled in automatically from the logged in user. The username is accessible doing something like <sec: username> which retrieves the logged-in user from the CAS.
So, I would like to not have the "author" field in the create.gsp scaffolded view. Very much in the same way that dateCreated and lastUpdated get filled automatically.
Thank you very much!