Skip to content

Instantly share code, notes, and snippets.

@seungjin
Created January 8, 2011 17:09
Show Gist options
  • Select an option

  • Save seungjin/770994 to your computer and use it in GitHub Desktop.

Select an option

Save seungjin/770994 to your computer and use it in GitHub Desktop.
ruby hash to url param
def do_it(params)
params.collect do |key,val|
"#{CGI.escape(key.to_s)}=#{CGI.escape(val)}"
end.join('&')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment