Ben
Ben

Reputation: 25

Turning a commented URL into a clickable link in Rails?

I've created a site with commenting 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!

Upvotes: 0

Views: 343

Answers (2)

Evan Walsh
Evan Walsh

Reputation: 442

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

Upvotes: 1

inntran
inntran

Reputation: 1033

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

Upvotes: 0

Related Questions