开发者

Turning a commented URL into a clickable link in Rails?

开发者 https://www.devze.com 2023-04-04 08:30 出处:网络
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

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

精彩评论

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