解决方法
Rails有一个
auto_link文本助手.
auto_link("Go to http://www.rubyonrails.org and say hello to david@loudthinking.com") # => "Go to <a href=\"http://www.rubyonrails.org\">http://www.rubyonrails.org</a> and # say hello to <a href=\"mailto:david@loudthinking.com\">david@loudthinking.com</a>" auto_link("Visit http://www.loudthinking.com/ or e-mail david@loudthinking.com",:link => :urls) # => "Visit <a href=\"http://www.loudthinking.com/\">http://www.loudthinking.com/</a> # or e-mail david@loudthinking.com"