Topic: New to Rails and stuck!

Ok, so I'm following along with one of DHH's screencasts, the one where he's creating a blog. Well. along the way he decides to add comments to posts. In doing so he creates the model Comment and a table in the DB called comments. I follow all of this and also create a has_many relationship for posts with comments in the post.rb and a belongs_to relationship for comments to posts in the comments.rb.

Well, as you can see by the error and the source below, something happens when I go to add the comments to the show.rhtml.

Can anyone tell me why I'm getting this error?


-------------ERROR-------------

Showing app/views/content/show.rhtml where line #8 raised:

undefined method `comments' for #<Post:0x3600588>

Extracted source (around line #8):

5:
6:
7: <h2>Comments</h2>
8: <% for comment in @post.comments %>
9:   <%= comment.body %>
10:   <hr />
11: <% end %>

Re: New to Rails and stuck!

It's one thing posting here and then the rails mailing list 5mins later, but you could've updated it and told us that it's been answered on the mailing list so that you don't get a duplicate reply.