Ruby on Rails Sunday, July 31, 2011


I am totally stuck with a problem creating an object. This is the request:

Started POST "/posts/31/comments" for at 2011-07-31 21:11:01 +0200
Processing by CommentsController#create as HTML
Parameters: {"utf8"=>"✓",
"comment"=>{"email"=>"", "website"=>"", "comment"=>""},
"commit"=>"Create Comment", "post_id"=>"31"}

So I think I would get the object with the following code within the
create action of the CommentsController.

def create
@comment =[:comment])

But an inspect on @comment shows me that the object is empty:

#<Comment id: nil, comment: "", email: "", website: "", post_id: nil,
created_at: nil, updated_at: nil>

May anyone give me a hint what i am doing wrong?

I appreciate your help. Thanks.

Kind regards,


You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment