title: Why is this rails view spitting out a raw array at the end of an .each do loop?
body: <p>I am stumped by this strange output in my Rails view.  Here is my model:</p>
  
  <pre><code>class Comment &lt; ActiveRecord::Base
    belongs_to :post
  end
  </code></pre>
  
  <p>Here is the relevant part of my view. I have isolated the problem to this block of code, specifically whatever happens after the last iteration and before the very end of the loop <code>&lt;% end %&gt;</code>.  If I comment out the actual text printed in each iteration, the raw array still prints.</p>
  
  <pre><code>&lt;h2&gt;Comments&lt;/h2&gt;
    &lt;%= @post.comments.each do |comment| %&gt;
      &lt;p&gt;
        &lt;strong&gt;Commenter:&lt;/strong&gt;
        &lt;%= comment.commenter %&gt;
      &lt;/p&gt;
      &lt;p&gt;
        &lt;%= comment.body %&gt;
      &lt;/p&gt;
    &lt;% end %&gt; 
  </code></pre>
  
  <p>Here is the strange output (w/ sample
  comments.): </p>
  
  <blockquote>
    <p><strong>Commenter: Michael</strong></p>
    
    <p>Good post.</p>
    
    <p><strong>Commenter: Michael</strong></p>
    
    <p>Good post.</p>
    
    <p><strong>Commenter: Michael</strong></p>
    
    <p>Test.</p>
    
    <p><strong>Commenter: John</strong></p>
    
    <p>Is the array still printing funny?</p>
  </blockquote>
  
  <pre><code> [#&lt;Comment id: 1, commenter:
   "Michael", body: "Good post.",
   post_id: 1, created_at: "2011-01-12
   03:51:20", updated_at: "2011-01-12
   03:51:20"&gt;, #&lt;Comment id: 2,
   commenter: "Michael", body: "Good
   post.", post_id: 1, created_at:
   "2011-01-12 03:52:06", updated_at:
   "2011-01-12 03:52:06"&gt;, #&lt;Comment id:
   3, commenter: "Michael", body:
   "Test.", post_id: 1, created_at:
   "2011-01-12 03:52:24", updated_at:
   "2011-01-12 03:52:24"&gt;, #&lt;Comment id:
   4, commenter: "John", body: "Is the
   array still printing funny?", post_id:
   1, created_at: "2011-01-12 03:57:20",
   updated_at: "2011-01-12 03:57:20"&gt;]
  </code></pre>
  
  <p>Finally, here is how the development log is reading.  They all look like this.</p>
  
  <pre><code>Started GET "/posts/1" for 127.0.0.1 at 2011-01-11 22:01:52 -0600
    Processing by PostsController#show as HTML
    Parameters: {"id"=&gt;"1"}
    [1m[36mPost Load (0.1ms)[0m  [1mSELECT "posts".* FROM "posts" WHERE ("posts"."id" = 1) LIMIT 1[0m
    [1m[35mComment Load (0.3ms)[0m  SELECT "comments".* FROM "comments" WHERE ("comments".post_id = 1)
  Rendered posts/show.html.erb within layouts/application (57.5ms)
  Completed 200 OK in 73ms (Views: 61.1ms | ActiveRecord: 0.4ms)
  </code></pre>
  
  <p>Does anybody know what is causing this?  If this were PHP, I'd guess I left a print_r somewhere in the code. But it isn't and I didn't do anything like that.</p>