On my site a user has a personal profile with a link to his personal external website. The url of the sites I store in a postgresql database under the name website>
I'm working with Rails 5 and I had the same problem. All I need to do to fix it, was to include the protocol on my link_to
tag. E.g. I had www.google.com.mx
, then, it should be http://www.google.com.mx
. And that's it it works just fine like in the official doc is mentioned.
So, finally I just have something like this in my view:
<%= link_to (content_tag(:i, "help", class: 'material-icons tiny')), " http://www.google.com.mx", target: "_blank", rel: "alternate" %>
Which is the same as:
<%= link_to "help", "http://www.google.com.mx", target: "_blank", rel: "alternate" %>
I hope it helps somebody else.