While looking for a Ruby equivalent of PHP's parse_query(), or Python's urlparse.parse_qs (i.e. the reverse of ActiveSupport's Object#to_query extension), I ran into several limited/failed implementations. Addressable is the only one that seems to do it right.
>> require 'active_support'
>> str_ex = "bar".to_query('foo')
=> "foo=bar"
>> array_ex = [1, 2, 3].to_query('foo')
=> "foo%5B%5D=1&foo%5B%5D=2&foo%5B%5D=3"