I had a form that used virtual attributes to do on the fly creation/editing of child associations. I needed an ajax update action to do some calculation. I discovered that when the form was serialized by Prototype, Rails no longer parsed the params correctly. This was because Prototype was serializing the array params depth-first, rather than maintaining the physical order of params on the page. ie, it was doing:
x[][a]=1&x[][a]=2&x[][b]=3&x[][b]=4 instead of x[][a]=1&x[][x]=3&x[][a]=1&x[][b]=4
However, I considered the fault to be mainly action_controller, because I could also construct a form that resulted in mangled query params just by laying out records vertically instead of horizontally.
So I rewrote UrlEncodedPairParser to correctly handle either depth-first or breadth-first order of array params.
This has the necessary side effect that if the array params are breadth-first, there can't be any "holes" -- every key must be supplied for every row in order for all keys to be correctly associated with their respective true. With the old parser, this was partially true anyway.
I originally attached this patch to #8775, which describes the same bug I had but treats it as a prototype problem, and #9030, which addresses a similar bug which this patch also fixes. This patch also incorporates a patch to HashWithIndifferentAccess from #9030.