title: Why is ActiveRecord Association CollectionProxy data being output to the screen as text?
body: <p>For some reason, the ActiveRecord Association CollectionProxy results are being displayed on the page as raw text.</p>
  
  <p>Here's what it looks like (please excuse the background-colors, still in mock-up stages)</p>
  
  <p><a href="https://i.stack.imgur.com/1moCF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1moCF.png" alt="enter image description here"></a></p>
  
  <p>As you can see, the images themselves are appropriately returned, yet under the images, the raw array text itself is being shown.</p>
  
  <p>Here's the related code for this section...</p>
  
  <pre><code>&lt;div class="container-fluid"&gt;
    &lt;div class="row"&gt;
      &lt;div class="col-sm-12 text-center" id="image-viewer"&gt;
        &lt;% if @task_document_images.present? %&gt;
          &lt;div class="col-sm-1 nav flex-column text-center" id="image-thumbnail-navigation"&gt;
            &lt;%= @task_document_images.flatten.uniq.each do |tdi| %&gt;
              &lt;%= image_tag tdi.file_url(:small) %&gt;
            &lt;% end %&gt;
          &lt;/div&gt;
         ...
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>It appears to match the output generated by @task_document_images.flatten.uniq, which is:</p>
  
  <pre><code> [#&lt;Image:0x007f26a9e47498 id: 1, user_id: 1, created_at: Sun, 12 Aug 2018 21:23:38 UTC +00:00, updated_at: Sun, 12 Aug 2018 21:23:38 UTC +00:00, file: "dd22780c71bed3d18140.jpg", parent_image_id: nil&gt;,
   #&lt;Image:0x007f26a9e47330 id: 2, user_id: 1, created_at: Sun, 12 Aug 2018 21:23:38 UTC +00:00, updated_at: Sun, 12 Aug 2018 21:23:38 UTC +00:00, file: "9214bf8dbfe30ae025c0.png", parent_image_id: nil&gt;]
  </code></pre>
  
  <p>Any ideas what may be causing the raw text to output to the view? Thank you in advance, please let me know if there's any other code you'd like to see.</p>