Both of these:
<%= content_tag("a", @a_model_instance.name, :href => @a_model_instance.url) %>
<a href="<%= @a_model_instance.url %>"><%= @a_model_instance.url %></a>
result in urls with href values of:
0.0.0.0:3000/model_name/www.the_url_i_want.com
How do you prevent this to get a
tags with href
values of www.the_url_i_want.com
?
@a_model_instance.url
returns the string www.the_url_i_want.com
.
edit - one solution
This works:
<%= content_tag("a", @a_model_instance.name, :href => "http://#{@a_model_instance.url}") %>
<a href="http://<%= @a_model_instance.url %>"><%= @a_model_instance.url %></a>
But seems very non-railsy
if you add http at the beginning of the url it shouldnt prepend the domain I think