开发者

Turning a commented URL into a clickable link in Rails?

I've created a site with comme开发者_开发技巧nting functionality in rails but whenever a user types in a link, it is unclickable and I have to copy and paste it into the browser. Are there any simple fixes for this? Thanks for your help!


You can install the rails_autolink gem, since the autolink functionality was removed from Rails in 3.1.


Before Rails 3.1, you can use a helper method in ActionView::Helpers::TextHelper called auto_link to achieve this.

See this: http://apidock.com/rails/ActionView/Helpers/TextHelper/auto_link

It was removed in Rails 3.1: http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜