Created
January 20, 2017 04:13
-
-
Save granolocks/2ba9c5ee7a823ed11ddfa81aeb40c2ce to your computer and use it in GitHub Desktop.
parse uri params jank af
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 parse_params(uri) | |
| CGI.unescape(uri.split("?").last).split('&').each_with_object({}) do |p,c| | |
| key, val = p.split('=') | |
| c[key] = val | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment