When I get down to this section of the ‘Getting Started’ tutorial… 8 Refactoring >> 8.1 Rendering Partial Collections
And I do the first change to the rendering of the existing comments - I get an error…
NoMethodError in Posts#show
Showing C:/Sites/blog/app/views/posts/show.html.erb where line #19 raised:
undefined method `comment’ for #Post:0x3eaaea8
Extracted source (around line #19):
16:
17: 18:Comments
19: <%= render @post.comments %> 20: 21:Add a comment:
22: <%= form_for([@post, @post.comments.build]) do |f| %>Not sure what I am doing wrong. The created file is named “app/views/comments/_comment.html.erb” as per tutorial. I note the render is @posts.comments and the file name is _comment - is that correct ? TIA, Dave