I have a URL of form http://www.example.com?foo=one&foo=two
I want to get an array of values ['one', 'two']
for foo
, but params[:foo]
only returns the first value.
I know that if I used foo[]
instead of foo
in the URL, then params[:foo]
would give me the desired array.
However, I want to avoid changing the structure of the URL if possible, since its form is provided as a spec to a client application. is there a good way to get all the values without changing the parameter name?