如何在电子邮件模板中使用应用程序帮助器方法

ber*_*kes 1 actionmailer ruby-on-rails-4

我在以下位置定义了一个助手ApplicationHelper

module ApplicationHelper
  def url_for_portal
    URI("https://example.com/")
  end
end
Run Code Online (Sandbox Code Playgroud)

并想在邮件模板中使用它,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 %>)
Run Code Online (Sandbox Code Playgroud)

如何在邮件模板中编写和使用辅助方法?

eug*_*gen 5

添加helper :application到您的ClientMailer班级。