Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strong parameters permit Array of Arrays

I have data I am trying to POST that looks like { foo: [[:bar, 1], [:baz, 0]] }.

How do I permit that using strong parameters? The closest I can get is

params.permit(foo: [[]]) which returns {"foo"=>[]}

like image 218
maletor Avatar asked Nov 04 '13 23:11

maletor


1 Answers

Maletor,

it seems to me that the strong parameters can't handle array of array. I did read the code of it in github and it deals with Symbol, String and Hash.

For this case you'll have to handle with your own code.

like image 154
Marcelo Xavier Avatar answered Nov 06 '22 05:11

Marcelo Xavier