Skip to content

Instantly share code, notes, and snippets.

@maxd
Created December 10, 2014 15:33
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 maxd/617e9ac32c638610ffd2 to your computer and use it in GitHub Desktop.
Save maxd/617e9ac32c638610ffd2 to your computer and use it in GitHub Desktop.
def append_additional_url_params(url)
uri = URI(url)
params = URI.decode_www_form(uri.query || '')
params += additional_url_params.to_a
uri.query = URI.encode_www_form(params).to_s
uri.to_s
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment