In Python, I can do this:
>>> import urlparse, urllib >>> q = urlparse.parse_qsl(\"a=b&a=c&d=e\") >>> urllib.urlencode(q) \'a=
The way rails handles query strings of that type means you have to roll your own solution, as you have. It is somewhat unfortunate if you're dealing with non-rails apps, but makes sense if you're passing information to and from rails apps.