title: use url_for in gem
body: <p>Im writing a gem that includes some views and in one of those I need to use the <code>link_to</code> method which depends the <code>url_for</code> method. Both aren't available by default so I tried to include the needed Modules</p>
  
  <pre><code>include ActionView::Helpers
  include ActionDispatch::Routing
  include Rails.application.routes.url_helpers
  </code></pre>
  
  <p>What doesnt work because <code>Rails.application</code> is <code>nil</code> so I cant get the routes and the contained url helpers. I also found <a href="https://stackoverflow.com/questions/8574866/how-to-use-the-url-for-method-in-my-own-gem">this</a> approach but I dont like it because its quick and dirty. I want the module to be included after the init so I can access the routes. Is there any way to arrange such sutuation? </p>