title: Rails: Accept 2D array of strings with strong parameters
body: <p>We have a Rails controller that gets the following data:</p>
  <pre><code>params = ActionController::Parameters.new({
      &quot;requests&quot;: [{
          &quot;params&quot;: {
              &quot;facets&quot;: [&quot;user.id&quot;, &quot;user.type&quot;],
              &quot;facetFilters&quot;: [
                  [&quot;user.type:Individual&quot;]
              ]
          }
      }, {
          &quot;params&quot;: {
              &quot;facets&quot;: &quot;user.type&quot;
          }
      }]
  })
  </code></pre>
  <p>We want to use strong parameters to accept this data, but I haven't yet seen a pattern that will let us accept the 2D array in <code>facetFilters</code>. I'm tinkering with the following:</p>
  <pre><code>    params[:requests].each do |request|
        request[:permitted] = true
        request[:params].each do |o|
          if ['facets', 'facetFilters'].include?(o.first)
            begin
              o[:permitted] = true 
            rescue
            end
          end
        end
      end
  </code></pre>
  <p>As one can see not all attributes are permitted (the permitted attributes don't get passed to children elements), as this returns:</p>
  <pre><code>[&lt;ActionController::Parameters {&quot;params&quot;=&gt;&lt;ActionController::Parameters {&quot;facets&quot;=&gt;[&quot;user.id&quot;, &quot;user.type&quot;], &quot;facetFilters&quot;=&gt;[[&quot;user.type:Individual&quot;]]} permitted: false&gt;, &quot;permitted&quot;=&gt;true} permitted: false&gt;, &lt;ActionController::Parameters {&quot;params&quot;=&gt;&lt;ActionController::Parameters {&quot;facets&quot;=&gt;&quot;user.type&quot;} permitted: false&gt;, &quot;permitted&quot;=&gt;true} permitted: false&gt;]
  </code></pre>
  <p>And there are lots of permitted: false in there...</p>
  <p>Is it possible to accomplish this goal? Any pointers would be super helpful!</p>