Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The method `add_template_helper` does not seem to work in Rails 6.1

After updating my project to Rails 6.1 I get this error:

NoMethodError:
  undefined method `add_template_helper' for ApplicationMailer:Class

In the documentation does not seem to be deprecated.

like image 945
Daniel Avatar asked Jan 01 '21 08:01

Daniel


1 Answers

So, apparently, this method was deleted without deprecation warning in this commit:

https://github.com/rails/rails/commit/cb3b37b37975ceb1d38bec9f02305ff5c14ba8e9

So, the fix for this issue is to replace:

class MyMailer < ApplicationMailer
  add_template_helper MyHelper

With:

class MyMailer < ApplicationMailer
  helper MyHelper
like image 98
Daniel Avatar answered Jan 01 '23 21:01

Daniel