Closed tikeswar closed 10 years ago
params
to the new Post
instance whereas the second will only populate the content
property.Hi Peter:
1. I see, thank you!
2. It is working fine now, and not getting that error. Thank you for the explanation!
Have couple of issues with Listing 6.4 (PostController.groovy, Pg. 142):
1. In the code it reads
def addPost = {
. Should it bedef addPost() {
on a newline instead?2. Issue with the
params
. If I do as in the listingdef post = new Post(params)
, I get an error. However, if I dodef post = new Post(content: params.content)
it seems to work fine. Can someone please explain the difference?I am using Grails version: 2.3.1
Thank you in advance for your help.