R – n alternative to rail’s auto_link helper method


I'm using the auto_link method in Rails to turn urls in plain text to clickable links. It works pretty good most of the time.


google.com doesn't create a link

Is there something else out there that provides better coverage of urls? Or is there anyway I can easily modify the Rails code to include .coms and .net without a http or www start string?

Best Solution

auto_link uses AUTO_LINK_RE which you can override.

you can place a file in config/initializers

module ActionView::Helpers::TextHelper

    silence_warnings do # you might need this to get rid of the warning
        AUTO_LINK_RE = # your own definition here

It should work, but I never tried myself.

Related Question