Access helpers from mailer?

前端 未结 11 1826
夕颜
夕颜 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:26

    None of the *_path helpers are accessible by default inside of an email. It is necessary instead to use the *_url form of the wanted helper. So, for instance, instead of using user_path(@user) it is necessary to use user_url(@user). See at Action Mailer basics.

提交回复
热议问题