title: Using standard scaffold form_for with restful resources with custom :controller
body: <p>I have a 'account roles' controller (for my AccountRole model) in my application using views generated by the standard scaffold generator. This controller is nested into my 'accounts' controller (for my Account model) using the following routing configuration:</p>
  
  <pre><code>resources :accounts do
    resources :people, :controller =&gt; :account_roles
  end
  </code></pre>
  
  <p>This results in routing helpers like <code>account_people_path</code> (<code>/accounts/1/people</code>) and <code>account_person_path</code> (<code>/accounts/1/person/1</code>). All well and good.</p>
  
  <p>My problem comes in the default generated <code>_form.html.erb</code> partial. This file looks like this:</p>
  
  <pre><code>&lt;%= form_for([@account,@account_role]) do |f| %&gt;
    &lt;!-- Rest of form --&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>I've customised this view to cope with the nested resources, but my use of the <code>:controller</code> option in my routing is causing me problems I think.</p>
  
  <p>My view spec for the 'new' and 'edit' views (both of which use this partial) is resulting in the following error:</p>
  
  <pre><code>ActionView::Template::Error:
     undefined method `account_account_role_path' for #&lt;#&lt;Class:0x105334360&gt;:0x105300c18&gt;
  </code></pre>
  
  <p>I <em>think</em> what's happening here is that form_for is trying to 'guess' the route helper for these resources. I know I could override the url by using the <code>:url</code> option to form_for, but that feels like a bit of a cop-out.</p>
  
  <p>Am I missing an obvious solution to this that allows me to combine the :controller routing option with <code>form_for</code>'s resource oriented style?</p>