Escapes/Encodes the string, replacing all unsafe characters with codes.
url_encode ( str )
u ( s )
str - String to be encoded.
Returns escaped/encoded version of str
require 'erb'
include ERB::Util
url = url_encode("http://example.com/?a=ruby url encode")
puts url
http%3A%2F%2Fexample.com%2F%3Fa%3Druby%20url%20encode