Created
September 15, 2023 05:15
-
-
Save dkam/9f5daceeff10f2b87d9301bd12e387d8 to your computer and use it in GitHub Desktop.
Add query parameter with URI
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
URI(url).tap {|u| u.query = URI.encode_www_form(CGI.parse(u.query || "").merge({ref: 123})) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment