Regression: Cannot pass Array of Arrays #103

Open
maletor opened this Issue Feb 20, 2013 · 4 comments

Comments

Projects
None yet
5 participants

maletor commented Feb 20, 2013

I can't pass an array of arrays like this:

tips = [[:photo_suggest, 3], [:foo, "bar"]]
put :update, id: 34, tips: tips, format: :json

...

params.require(:tips)
# => [[:photo_suggest, 3], [:foo, "bar"]]

params.permit(:tips => [])
# => {}

I believe this is because Arrays are only allowed explicitly and even still the contents of the Array must be a scalar value, of which an Array is not.

bencates commented Feb 7, 2014

This appears to still be an issue.

nfm commented May 6, 2015

I don't have much to offer apart from a +1 - this is still the case. I'm not sure what the security implications are of allowing multi-dimensional arrays. In my case, I want to submit something like:

movements: { id: 1, path: [[0, 0], [100, 100]] }

There's no way to specify that an array of arrays of integers is permitted.

+1 for this issue

+1

It would be nice to do the following:

lambda = -> { | path |  } # My Filter Block
params.permit(path: lambda)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment