Permit array in params
<p>I have the following JSON:</p>

<pre><code>{
    "name": "pizza",
    "ingredients": [
        {"name": "tomato", "amount": 3, "unit": "un"},
        {"name": "chesse", "amount": 100, "unit": "gr"}
    ]
}
</code></pre>

<p>And I pass this JSON using POST to my controller, then I need to trust this paramters but I'm not be able to permit the array of hash <code>ingredients</code>.</p>

<p>How to permit it?
I tried <code>params.permit(:ingredients).permit(:name, :amount, :unit).to_h</code>, but it doesn't work.</p>