tenderlove / rails_autolink

The auto_link function from Rails
MIT License
588 stars 91 forks source link

auto_link method not found just after a require #59

Closed AlexCppns closed 2 years ago

AlexCppns commented 8 years ago

undefined methodauto_link' for #<CampaignSerializer:..`

asoap commented 8 years ago

I just ran into this also. It turns out I was using this in the model. This is apparently only a view helper, so it wouldn't work. Perhaps you're doing something similar?

coreyhaines commented 8 years ago

Yeah, this is mixed into the view helpers. https://github.com/tenderlove/rails_autolink/blob/master/lib/rails_autolink/helpers.rb#L9-L11

asoap commented 8 years ago

Yeah. I just used the Sanitize gem in the model to remove any extra html tags I didn't want, then used this in the view.

kssmilik commented 7 years ago

In serializers you can use ActionController::Base.helpers.auto_link(text)