0

I am building my own blog in Rails. One thing I would like to do is convert urls in comments into actual links.

I am not sure how to do this without opening up the page to injection.

Is there a library/plugin (or technique I am not thinking of) that does this?

JD Isaacks
  • 56,088
  • 93
  • 276
  • 422

1 Answers1

2

apparently there's a gem to do that in Rails 3.1+ rails_autolink

More info in this thread : Replacing the 'auto_link' method in Ruby on Rails 3.1 https://github.com/tenderlove/rails_autolink

If it's Rails 3.0 and down, then use the auto_link helper that is explained here : Convert plain text URLs to HTML hyperlinks in Ruby on Rails?

Community
  • 1
  • 1
Anthony Alberto
  • 10,325
  • 3
  • 34
  • 38