Re: Building querystrings with ruby

}.join("=") }.join("&")

Ignore my stupidity above; this is shorter and less redundant:

“?” << map{ |kv| kv.map{ |e| CGI.escape(e) }.join("=") }.join("&")

Paul.

golfing? :slight_smile:

“?#{map{|k, v| “#{CGI.escape k}=#{CGI.escape v}”} * ‘&’}”

cheers

Simon

On 15/03/06, Kroeger, Simon (ext) [email protected] wrote:

golfing? :slight_smile:

“?#{map{|k, v| “#{CGI.escape k}=#{CGI.escape v}”} * ‘&’}”

All right then! :slight_smile:

“?”<<map{|h|h.map{|e|CGI.escape(e)}‘=’}‘&’

Paul.