title: Strong parameters in rails with array as root object
body: <p>I have an array of objects being passed to my controller with this structure:</p>
  
  <pre><code>[
      {
          "id": 1,
          "fruit_ids": [1, 2, 3]
      },
      {
          "id": 2,
          "fruit_ids": [4, 5, 6]
      },
  ]
  </code></pre>
  
  <p>The root object, is not a <code>{}</code>, and instead is a array. I'm not sure how to write a strong params state for this case. I have tried</p>
  
  <pre><code>params.permit [:id, fruit_ids: []]
  </code></pre>
  
  <p>and other similar options, but it wasn't permitting it.</p>
  
  <p>Edit:</p>
  
  <p>I'm not sending a JSON object in my request body. I'm sending a JSON array. When I inspect the value of <code>params</code> in my controller, this is the result:</p>
  
  <pre><code>{
      "_json" =&gt; [
          {"id"=&gt;1, "fruit_ids"=&gt;[1, 2, 3]},
          {"id"=&gt;2, "fruit_ids"=&gt;[4, 5, 6]}
      ],
      "format"=&gt;"json",
      "controller"=&gt;"...",
      "action"=&gt;"..."
  }
  </code></pre>