You should try the auto_link gem.
They give an example of playing around with the link text:
post_body = "Welcome to my new blog at http://www.myblog.com/. Please e-mail me at me@email.com."
auto_link(post_body, :html => { :target => '_blank' }) do |text|
truncate(text, 15)
end
# => "Welcome to my new blog at <a href=\"http://www.myblog.com/\" target=\"_blank\">http://www.m...</a>.
Update
Try this:
<%= auto_link(comment.content, html: {target: '_blank'}) do |text| %>
# if URI.parse(text).host doesn't work try a regex:
<%= text.match(/http:\/\/([^\/]*).*/)[1] %> # is there a better way to do this regex?
# also try just <% instead of <%= if you get weird outputs.
<% end %>
If you get any errors add them to your question.