Apr 24, 2023 code Encode URLs with Ruby Prior to Ruby 3 the way to encode URLs was using URI.escape, after Rails 3 you need to use CGI.escape