title: rails rendering collection not working - undefined local variable or method
body: <p>I am trying to create a feed that displays all comments for a model.</p>
  
  <p><strong>_comments.html.erb</strong></p>
  
  <pre><code>&lt;% if @comments.any? %&gt;
      &lt;ol&gt;
        &lt;%= render partial: 'shared/comment_feed', collection: @comments %&gt;
      &lt;/ol&gt;
      &lt;%= will_paginate @comments %&gt;
  &lt;% else %&gt;
      &lt;h2&gt;Be the first one to comment on this episode!&lt;/h2&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p><strong>_comment_feed.html.erb</strong></p>
  
  <pre><code>&lt;li id="&lt;%= comment.id %&gt;"&gt;
    &lt;%= link_to gravatar_for(comment.user), comment.user %&gt;
    &lt;span class="user"&gt;
      &lt;%= link_to comment.user.name, comment.user %&gt;
    &lt;/span&gt;
    &lt;span class="content"&gt;&lt;%= simple_format comment.content %&gt;&lt;/span&gt;
    &lt;span class="timestamp"&gt;
      Posted &lt;%= time_ago_in_words(comment.created_at) %&gt; ago.
    &lt;/span&gt;
    &lt;% if current_user?(comment.user) %&gt;
      &lt;%= link_to "delete", comment, method: :delete,
                                     confirm: "Are you sure?",
                                     title: comment.content %&gt;
    &lt;% end %&gt; 
  &lt;/li&gt;
  </code></pre>
  
  <p>The above code gives me an <strong><em>undefined local variable or method `comment'</em></strong> error. Doesn't rails automatically generate comment when a partial is used to render comments collections? Any help would be greatly appreciated.</p>