Skip to content

Instantly share code, notes, and snippets.

@laktek
Created October 5, 2009 05:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laktek/201904 to your computer and use it in GitHub Desktop.
Save laktek/201904 to your computer and use it in GitHub Desktop.
"test=abc&check=1".split("&").inject({}) {|result, elem| t=elem.split("="); result[t[0]] = t[1]; result }
>> {"test"=>"abc", "check"=>"1"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment