title: Rails - URL helpers not working in mailers
body: <p>I tried:</p>
  
  <pre><code>class MyMailer
    def routes
      Rails.application.routes.url_helpers
    end
  
    def my_mail
      @my_route = routes.my_helper
      ... code omitted 
    end
  </code></pre>
  
  <p>Also inside mailer:</p>
  
  <pre><code>include Rails.application.routes.url_helpers
  
  def my_mail
    @my_route = my_helper
  </code></pre>
  
  <p>Also, the simple way, in mailer template:</p>
  
  <pre><code>= link_to 'asd', my_helper
  </code></pre>
  
  <p>But then when I try to start console I get:</p>
  
  <pre><code>undefined method `my_helper' for #&lt;Module:0x007f9252e39b80&gt; (NoMethodError)
  </code></pre>
  
  <h1>Update</h1>
  
  <p>I am using the <code>_url</code> form of the helper, i.e. <code>my_helper_url</code></p>