Access helpers from mailer?

前端 未结 11 1813
夕颜
夕颜 2020-12-05 17:25

I have trying to access helper methods from a rails 3 mailer in order to access the current user for the session.

I put the helper :application in my mailer class,

11条回答
  •  死守一世寂寞
    2020-12-05 17:34

    To enable you to access application helpers from the ActionMailer views, try adding this:

    add_template_helper(ApplicationHelper)
    

    To your ActionMailer (just under your default :from line).

提交回复
热议问题