In order to get my mailer and the view to render correctly, I have to do the following:
include ::KamilHelper
add_template_helper(KamilHelper)
since i use the method do_it() both here:
class Notifier < ActionMailer::BAse
def run_it
do_it()
end
end
and in its corresponding view:
<%= do_it() %>.
Otherwise, I get:
undefined method `do_it' for #<Notifier:0x00000102b24af0>
for the view or the mailer?
Are you doing
include ::KamilHelperin a controller? If so, this includes the methods from the helper into the current class (e.g. the controller), but methods from a controller are not available in a view.add_template_helpermakes those methods available to templates rendered from the current controller (by callinginclude ::KamilHelperinside the modules that are available to the view templates).