title: How to append JSON objects together in Ruby
body: <p>I am trying to create a group of map markers with the results of <code>to_gmaps4rails</code> in an <code>each</code> block.  On an array with valid geo coordinates the <code>to_gmaps4rails</code> method produces valid JSON.  </p>
  
  <p>I'm using Mongoid and my geo coordinates are in a sub-collection like so:</p>
  
  <pre><code>Account.locations.coordinates  
  </code></pre>
  
  <p>Here is my controller code. <code>nearby_sales</code> is a collection of <code>Accounts</code>:</p>
  
  <pre><code>@json = String.new
  nearby_sales.each do |sale|
    @json &lt;&lt; sale.locations.to_gmaps4rails
  end
  </code></pre>
  
  <p>The browser complains about my <code>@json</code> not being well-formed.
  Is there a Ruby way to append valid JSON together?  </p>