[Feature Request] Handle deserialization of objects within arrays

Right now when passing parameters through jQuery, it serializes something like:

{ order: [{ name: “last_name”, dir: “asc” }, name: “first_name”, dir: “asc” }] }



Then on the Rails side, it gets interpreted as:

{“order”=>{“0”=>{“name”=>“last_name”, “dir”=>“asc”}, “1”=>{“name”=>“first_name”, “dir”=>“asc”}}}

At first thought it looked like a bug, but it’s really a problem with how the serialization/deserialization can be interpreted. Here’s an article that goes further into it: http://benalman.com/news/2009/12/jquery-14-param-demystified

Since this is such a common problem, can something be built into Rails to handle it? I would love if it worked by default, but I guess since you might sometimes want the current output, maybe there’s a flag that can be passed to tell Rails to convert the hash into an array. Let me know if there are better alternatives.

I know there are some solutions available, such as using JSON.stringify, but that won’t work with GET requests.