Shopify/batman — pull request #302 by ktusznio (2012-01-11 22:10:53+00:00)
Title: When encoding array parameters, don't encode the array indices

This changes the encoding of {foo: [{a:1, b: 2}]} from "foo[0][a]=1&foo[0][b]=2" to "foo[][a]=1&foo[][b]=2".

This change is necessary to properly encode/decode arrays of objects, because rack (as of 1.0.0) doesn't deserialize nested arrays properly.

From [jQuery's source](https://github.com/jquery/jquery/blob/master/src/ajax.js#L810), on which `buildParams` in `batman.solo.coffee` is based:

```
// If array item is non-scalar (array or object), encode its
// numeric index to resolve deserialization ambiguity issues.
// Note that rack (as of 1.0.0) can't currently deserialize
// nested arrays properly, and attempting to do so may cause
// a server error. Possible fixes are to modify rack's
// deserialization algorithm or to provide an option or flag
// to force array serialization to be shallow.
```