URL encode a string in Ruby

By: Jeeva Printer Friendly Format    

escape(string)

URL-encode a string.

  url_encoded_string = CGI::escape("'Stop!' said Fred")
     # => "%27Stop%21%27+said+Fred"


Ask a Question



Most Viewed Articles (in Ruby )

Latest Articles (in Ruby)

Comment on this tutorial