> -----Original Message-----
> From: Paul Battley [mailto:pbattley / gmail.com] 
> Sent: Wednesday, March 15, 2006 10:09 AM
> To: ruby-talk ML
> Subject: Re: Building querystrings with ruby
> 
> On 15/03/06, Paul Battley <pbattley / gmail.com> wrote:
> > And this is shorter still:
> >
> > "?" << to_hash.map{ |kv| kv.map{ |e| CGI.escape(e) 
> }.join("=") }.join("&")
> 
> Ignore my stupidity above; this is shorter and less redundant:
> 
> "?" << map{ |kv| kv.map{ |e| CGI.escape(e) }.join("=") }.join("&")
> 
> Paul.

golfing? :)

"?#{map{|k, v| "#{CGI.escape k}=#{CGI.escape v}"} * '&'}"

cheers

Simon