# Url\_for and arrays parameters (diff between 1.1.6 and 1.2.2)

**URL:** <https://www.ruby-forum.com/t/url-for-and-arrays-parameters-diff-between-1-1-6-and-1-2-2/87504>\
**Category:** Rails\
**Created:** [March 3, 2007, 4:24am UTC](https://www.ruby-forum.com/t/url-for-and-arrays-parameters-diff-between-1-1-6-and-1-2-2/87504 "2007-03-03T04:24:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrew](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@andrew](https://www.ruby-forum.com/u/andrew)\
**Post date:** [March 3, 2007, 4:24am UTC](https://www.ruby-forum.com/t/url-for-and-arrays-parameters-diff-between-1-1-6-and-1-2-2/87504/1 "2007-03-03T04:24:44Z")

</div>

Hello,

I apologize in advance if this has been brought up before, but I tried  
searching the previous convos for this and didn’t come up with anything.  
I’m wondering if I’m experiencing a bug or expected behavior in the new  
release of rails.

In Rails 1.2.2

I’m passing an array to url\_for like so…  
url\_for :controller =\> ‘test’, :action =\> ‘list’, :fields =\> %w(a b c d)

and that generates…  
“/test/list?fields=a%2Fb%2Fc%2Fd”

and when I look at my params object in my action fields contains a  
string that looks like “a/b/c/d”. Not much of an array there (although  
I can split it on the /).

When using Rails 1.1.6, the same url\_for call generates…  
“/test/list?fields[]=a&fields[]=b&fields[]=c&fields[]=d”

and the params object in my action contains an array like I would  
expect.

I’m certain the new routing engine is causing the difference, but is  
this a bug? Can somebody please explain why I’m experiencing the  
results I am?

Thanks,  
Andrew
