lundi 31 octobre 2016

Class methods accessible in Rails console but not in Rails Model

I installed the rinku gem http://ift.tt/SSWSGU

I can then:

rails c

and execute a command like: Rinku.auto_link('This is some text with link: http://hello.com', mode=:all, 'target="_blank"', skip_tags=nil) right in the console.

But the same command won't work in after_save in class Post < ActiveRecord::Base

uninitialized constant Post::Rinku

How do I access the class methods in Rinku in my Post after_save filter?

Aucun commentaire:

Enregistrer un commentaire