Skip to content

Instantly share code, notes, and snippets.

@rymawby
Last active December 16, 2015 22:39
Show Gist options
  • Select an option

  • Save rymawby/5508305 to your computer and use it in GitHub Desktop.

Select an option

Save rymawby/5508305 to your computer and use it in GitHub Desktop.
Convert query string into Hash
CGI::parse(query_string)
# OR
Rack::Utils.parse_nested_query(query_string)
# Rack one does them more in keeping with how params is formed - CGI:parse seems to add values to an array within the hash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment