Tutorial and Rails 2.0

Can someone help me over this last roadblock…

I’m working through the tutorial above in Rails 2.0

And when I make it to step: “Code Sample 5: post_comment action”
I can not get this to run under Rails 2.0. Errors.
Seems to blow up on the ‘Comment.new’ line
What is outdated or wrong about the syntax below?

def post_comment
@comment = Comment.new(
“post_id” => flash[:post_id],
“created_at” => Time.now,
“comment” => params[:comment][‘comment’]
if @comment.save
flash[:notice] = ‘Comment was successfully added.’
redirect_to :action => ‘show’, :id => flash[:post_id]

Kelly Greer
[email protected]
change nospam to yahoo

What are the errors? Are you getting all of the values you expect
(nothing is nil?)


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs