I found the solution by myself. Just include the TextHelper-Module at the start of the file to use helpers like simple_format:
include ActionView::Helpers::TextHelper
class SystemmailerObserver < ActiveRecord::Observer
[...]
end
Pergunta
I've ran into another problem while outsourcing some notification logic to observers.
Is it possible to use simple_format inside of an observer?
I need it to transform text from database and strings from I18n.t into nice looking emails.
Solução
I found the solution by myself. Just include the TextHelper-Module at the start of the file to use helpers like simple_format:
include ActionView::Helpers::TextHelper
class SystemmailerObserver < ActiveRecord::Observer
[...]
end