Forum: Ruby Re: Building querystrings with ruby

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Kroeger, Simon (ext) (Guest)
on 2006-03-15 12:11
(Received via mailing list)
> }.join("=") }.join("&")
> Ignore my stupidity above; this is shorter and less redundant:
> "?" << map{ |kv|{ |e| CGI.escape(e) }.join("=") }.join("&")
> Paul.

golfing? :)

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


Paul B. (Guest)
on 2006-03-15 13:06
(Received via mailing list)
On 15/03/06, Kroeger, Simon (ext) <removed_email_address@domain.invalid> wrote:
> golfing? :)
> "?#{map{|k, v| "#{CGI.escape k}=#{CGI.escape v}"} * '&'}"

All right then! :-)


This topic is locked and can not be replied to.