title: Build array from two hashes
body: <p>I try to build json with geojson datas.</p>
  
  <p>In my controller :    </p>
  
  <pre><code>def index
   .... 
    respond_to do |format|
      format.html
      format.json { render json: { type: 'FeatureCollection', features: pois_geojson + tracks_geojson} }
  end
  </code></pre>
  
  <p>and for show </p>
  
  <pre><code>def show
    ...
    respond_to do |format|
      format.html
      format.json { render json: { type: 'FeatureCollection', features: poi_geojson + track_geojson} }
    end
  </code></pre>
  
  <p>For index, all work fine and my json is good. I call this method for build json.</p>
  
  <p>Methods for show</p>
  
  <pre><code>def poi_geojson
      {
       type: 'Feature',
       RGeo::GeoJSON.encode(@poi.lonlat),
    properties: {
      name: @poi.name,
      :'marker-color' =&gt; '#00607d',
      :'marker-symbol' =&gt; 'circle',
      :'marker-size' =&gt; 'medium'
    }
  }
  end
  
  
  def track_geojson
      {
        type: 'Feature',
        geometry: RGeo::GeoJSON.encode(@track.path),
        properties: {
          :'color' =&gt; '#ff7800',
          :'weight' =&gt; '5',
          :'opacity' =&gt; '0.65'
        }
      }
  end
  </code></pre>
  
  <p>Methods for index</p>
  
  <pre><code>def pois_geojson
    @pois.map do |poi|
      {
        type: 'Feature',
        RGeo::GeoJSON.encode(poi.lonlat)
        properties: {
          name: poi.name,
          :'marker-color' =&gt; '#00607d',
          :'marker-symbol' =&gt; 'circle',
          :'marker-size' =&gt; 'medium'
        }
      }
    end
  end
  
  def tracks_geojson
    @tracks.map do |track|
      {
        type: 'Feature',
        geometry: RGeo::GeoJSON.encode(track.path),
        properties: {
          :'color' =&gt; '#ff7800',
          :'weight' =&gt; '5',
          :'opacity' =&gt; '0.65'
        }
      }
     end
  end
  </code></pre>
  
  <p>As you can see, the methods are similars, but I don't understand why for index it work fine, and not for the show.</p>
  
  <p>I have this error : </p>
  
  <blockquote>
    <p>`undefined method '+' for #` 
    for this line :
    `format.json { render json: { type: 'FeatureCollection', features: poi_geojson + track_geojson} }`</p>
  </blockquote>