Skip to content
This repository has been archived by the owner on Aug 17, 2017. It is now read-only.
This repository has been archived by the owner on Aug 17, 2017. It is now read-only.

Regression: Cannot pass Array of Arrays #103

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

Regression: Cannot pass Array of Arrays #103

maletor opened this issue Feb 20, 2013 · 4 comments

Comments

@maletor
Copy link

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
Copy link

bencates commented Feb 7, 2014

This appears to still be an issue.

@nfm
Copy link

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.

@sanjams2
Copy link

+1 for this issue

@shaw3257
Copy link

+1

It would be nice to do the following:

lambda = -> { | path |  } # My Filter Block
params.permit(path: lambda)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants