Created
November 22, 2010 10:21
-
-
Save mostlyfine/709780 to your computer and use it in GitHub Desktop.
Converts an hash object into a string suitable for use as a URL query string, using the given key as the param name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def queryize(hash) | |
| require 'cgi' unless defined?(CGI) && defined?(CGI::escape) | |
| hash.map{|i| i.map {|j| CGI.escape j.to_s}.join('=') }.join('&') | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment