I tried:
class MyMailer def routes Rails.application.routes.url_helpers end def my_mail @my_route = routes.my_helper ... code omitted end
Also inside the mail program:
include Rails.application.routes.url_helpers def my_mail @my_route = my_helper
In addition, an easy way, in the template of the mail program:
= link_to 'asd', my_helper
But then when I try to start the console, I get:
undefined method `my_helper' for #<Module:0x007f9252e39b80> (NoMethodError)
Update
I use the _url helper form, i.e. my_helper_url
ruby-on-rails actionmailer
juanpastas
source share