I have a helper defined in my application_helper.rb that I would like to use in my mailer view, but just doing
<%= helper_method(param) %>
in the mailer_view.html.erb file gets me an 'undefined method' error.
Is there another way to do this? I would hate to have to put the same helper somewhere else.
Thanks.
Apparently this has been asked before (who knew!) :). The answer is to include
helper ApplicationHelper
in the example_mailer.rb file:
class ExampleMailer < ApplicationMailer
helper ApplicationHelper
...
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With