lundi 20 février 2017

Permit multidimensional params

I receive this params:

<ActionController::Parameters 
  {"page_hierarchy"=>
      [<ActionController::Parameters 
          {"id"=>"6", "children"=>[
                         {"id"=>"1", "children"=>[{"id"=>"2"}, 
                         {"id"=>"5"}, 
                         {"id"=>"3"}, 
                         {"id"=>"18"}, 
                         {"id"=>"4"}]}]} permitted: false>]} permitted: false>

The page "page_hierarchy" is an array consisting of several "{id: , children: }" elements. A children as well is an array consisting of several "{id: , children: }" elements.

How can I permit params in this format?

Solutions like this one, did not work for me, because the array is multidimensional Permit array in params

Aucun commentaire:

Enregistrer un commentaire