title: How can I load UrlHelper and the routes in the Rails?
body: <p>I want to include the routes and the <code>link_to</code> method in a PORO. While testing this in the console I came accross this:</p>
  
  <p>If I include UrlHelper without the routes helper everything seems to work fine:</p>
  
  <pre><code>ruby-1.9.3-rc1 :001 &gt; Rails.version
  =&gt; "3.2.0.rc2" 
  ruby-1.9.3-rc1 :001 &gt; include ActionView::Helpers::UrlHelper
  =&gt; Object 
  ruby-1.9.3-rc1 :002 &gt; link_to "foo", Rails.application.routes.url_helpers.ponies_path
   =&gt; "&lt;a href=\"/ponies\"&gt;foo&lt;/a&gt;" 
  </code></pre>
  
  <p>If I include the routes:</p>
  
  <pre><code>ruby-1.9.3-rc1 :001 &gt; include ActionView::Helpers::UrlHelper
  ruby-1.9.3-rc1 :003 &gt; include Rails.application.routes.url_helpers
   =&gt; Object 
  ruby-1.9.3-rc1 :004 &gt; link_to "foo", ponies_path
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>NameError: undefined local variable or method `controller' for #&lt;ApplicationController:0x007fa1497ecc40&gt;
  </code></pre>
  
  <p>What am I doing wrong here?</p>