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?
Showing app/views/content/show.rhtml where line #8 raised:
undefined method `comments' for #<Post:0x3600588>
Extracted source (around line #8):
8: <% for comment in @post.comments %>
9: <%= comment.body %>
10: <hr />
11: <% end %>