Access helpers from mailer?

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

    Josh Pinter's answer is correct, but I discovered that it is not necessary.

    What is necessary is to name the helper correctly.

    NotificationMailerHelper is correct. NotificationMailersHelper (note the s) is not correct.

    The class and filename of the helper must match and be correctly spelled.

    Rails 3.2.2

提交回复
热议问题