Using time_ago_in_words in an ActionMailer template

How do I access time_ago_in_words from an email template in my rails app?

+3
source share
1 answer

you can use

def YourNotifierClass < ActionMailer::Base
  include ActionView::Helpers::DateHelper
  ...
end

to enable date helper.

+6
source

Source: https://habr.com/ru/post/1744886/


All Articles