ActionMailer calling shared methods

I’m trying to use a shared method from an ActionMailer template. The
method was originally in ApplicationHelper, but I’ve also tried it in
the base controller (application.rb), with and without
helper_method. In all cases, I get an error

undefined method `wgg_replace_crlf’ for #ActionView::Base:0x324b230

Here is the relevant block of code from the email template

address =
if @order.address.is_foreign
” +
” +
(@order.address.address_2.blank? ? ‘’ : “#
”) +
“#{}, #{@order.address.state} #
{@order.address.zip_code}” +
(@order.address.plus_four.blank? ? ‘’ : “-#

I have also tried prefacing the method call with
ApplicationHelper::, but that didn’t work either. How does one use
shared methods in email templates?


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs