我在ApplicationHelper
:
module ApplicationHelper
def url_for_portal
URI("https://example.com/")
end
end
并希望在邮件模板app/views/client_mailer/account_activation.md.erb
中使用它,但获得undefined method 'url_for_portal'
:
Activate your Example.com account by clicking on the link below:
[<%= url_for_portal %>](<%= url_for_portal %>)
如何在邮件模板中编写和使用帮助方法?
答案 0 :(得分:3)
将helper :application
添加到您的ClientMailer
课程。