title: Rails nested attributes passing with jQuery
body: <p>I have the following definition:</p>
  
  <pre><code>params.require(:sets).permit(:name, zones_attributes: [:latitude, :longitude])
  </code></pre>
  
  <p>And i would like to send them by ajax with jQuery, thing is I think i'm constructing it wrong because I keep getting this error: </p>
  
  <blockquote>
    <p>Unpermitted parameters: 0, 1</p>
  </blockquote>
  
  <p>This is what I'm sending:</p>
  
  <pre><code>{
  "sets"=&gt;{
      "name"=&gt;"America", 
      "zones_attributes"=&gt;{
          "0"=&gt;[
              "49.95121990866204", 
              "-117.861328125"
           ], 
           "1"=&gt;[
              "-33.578014746143985", 
              "-55.986328125"
            ]
         }
      }, 
      "action"=&gt;"create", 
      "controller"=&gt;"sets"
  }
  </code></pre>
  
  <p>I think the problem is the "key" value being added before the latitude/longitude value.
  This is how I'm adding those values:</p>
  
  <pre><code>  this.zones.push([marker.position.lat(), marker.position.lng()]);
  </code></pre>
  
  <p>Is there a way to add them without the keys? Or am I going through the wrong way?</p>
  
  <p><em>UPDATE</em></p>
  
  <p>ajax code:</p>
  
  <pre><code>$.ajax({
          type: "POST",
          url: '/zone_sets',
          data: { zone_sets: { name: map.markerListName ,zones_attributes: map.zones } },
          success: function (data) { $("input[name=zone_set]").append(data) },
        });
  </code></pre>