How can I remove "www", "http://", "https://" from strings using Ruby?
I tried this but it didn't work:
s.gsub('/(?:http?:\/\/)?(?:www\.)?(.*)\/?$/i', '')
Here what I'm doing in Rails:
<%= auto_link(job.description) do |url| url.truncate(25).gsub('http://', '') end %>
Url are truncated, but my goal is to remove the beginning of the links, such as "www" or "http://" so the link would look like "google.com/somepage/d...", not like "http://google.com/some..."