You can do it with URI
name = "Ruby Programming Language"
url = "http://example.com/?name=" + URI.escape(name)
puts url # http://example.com/?name=Ruby%20Programming%20Language
You can do it with URI
name = "Ruby Programming Language"
url = "http://example.com/?name=" + URI.escape(name)
puts url # http://example.com/?name=Ruby%20Programming%20Language