32

I am using Ruby on Rails 3.0.7 and I know that in the 3.1 version there won't be the auto_link method anymore (see the actionpack/lib/action_view/helpers/text_helper.rb for RoR 3.1).

Is there another way to have similar functions as the old auto_link method? That is, how can I replace that useful method in Ruby on Rails 3.1?

BTW: why will the auto_link method will be removed?

Zippie
  • 6,018
  • 6
  • 31
  • 46
user502052
  • 14,803
  • 30
  • 109
  • 188
  • 2
    Some reasons for its removal can be found on this question: http://stackoverflow.com/questions/9732216/why-was-auto-link-deprecated-in-rails – jasondoucette Jun 17 '12 at 16:03

2 Answers2

56

Rinku is a drop-in replacement for Rails 3.1 auto_link.

Auto-linking functionality has been removed from Rails 3.1, and is instead offered as a standalone gem, rails_autolink. You can choose to use Rinku instead.

require 'rails_rinku'

The rails_rinku package monkeypatches Rails with an auto_link method that mimics 100% the original one, parameter per parameter. It's just faster.

NARKOZ
  • 27,203
  • 7
  • 68
  • 90
Mori
  • 27,279
  • 10
  • 68
  • 73
1

Not sure why, but Aaron Patterson (Rails Core team) seem to have the gem for this as well https://github.com/tenderlove/rails_autolink (which worked fine for me, YMMV)

Ev Dolzhenko
  • 6,100
  • 5
  • 38
  • 30