title: Rails 3 - Why is my Post#Show view showing all of its comments' database data in one big block after the comments list?
body: <p>In a Rails 3 blog type of app, I have a polymorphic comments model, with Posts having Comments (through :commentable).  The Post#Show page has a form for comments that post through AJAX to a comment list below.  Everything is working fine EXCEPT that Rails is for some reason dumping a full list of the database entries for all comments on that post in []'s at the very bottom of my comments list.  I can't figure out where this is coming from and why!</p>
  
  <p>Here are maybe the relevant code chunks, please feel free to request more!  Thanks in advance.</p>
  
  <p>views/posts/show</p>
  
  <pre><code>...
  &lt;%= render 'comments' %&gt;
  ...
  </code></pre>
  
  <p>views/posts/_comments</p>
  
  <pre><code>&lt;%= render :partial =&gt; 'comments/form' %&gt;
  
  &lt;ul class="comments"&gt;
    &lt;% if @post.comments.empty? %&gt;
      &lt;li&gt;none yet&lt;/li&gt;
    &lt;% else %&gt;
      &lt;%= render :partial =&gt; 'comments/comment' %&gt;
    &lt;% end %&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>views/comments/comment</p>
  
  <pre><code>&lt;%= @comments.each do |comment| %&gt;
  &lt;li&gt;
    &lt;p class="comment_body"&gt;"&lt;%= comment.body %&gt;"&lt;/p&gt;
    &lt;br/&gt;
    &lt;p class="comment_info"&gt;&lt;%= comment.name %&gt; - &lt;%= time_ago_in_words(comment.created_at) %&gt; ago &lt;/p&gt;
  &lt;/li&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>posts controller</p>
  
  <pre><code>def show
    @post = Post.find(params[:id])
    @comments = @post.comments
    @commentable = @post
    @comment = Comment.new(:commentable =&gt; @post)
    @title = @post.author
  end
  </code></pre>
  
  <p>And here's where the error creeps in (from Page Source).  Right after the last comment </li> closes and before the comments  closes:</p>
  
  <pre><code>....
  &lt;/li&gt;
  [#&amp;lt;Comment id: 97, name: &amp;quot;hmmm?&amp;quot;, body: &amp;quot;hmmm&amp;quot;, created_a...
  &lt;/ul&gt;
  </code></pre>
  
  <p>What is that thing and why is it here!?  Thanks.</p>