How to use my view helpers in my ActionMailer views?

后端 未结 7 1755
清酒与你
清酒与你 2020-11-30 18:17

I want to use the methods I defined in app/helpers/annotations_helper.rb in my ReportMailer views (app/views/report_mailer/usage_report.text.html.erb

7条回答
  •  情话喂你
    2020-11-30 18:44

    For all mailers in Rails 3 (setting "application" helper):

    # config/application.rb:
    ...
    config.to_prepare do
      ActionMailer::Base.helper "application"
    end
    

提交回复
热议问题