title: Rails 3 nested resource route problem as form_for
body: <p>I have nested resources like this in my routes.rb - (<a href="https://gist.github.com/812840" rel="noreferrer">my rake:routes gist</a>)</p>
  
  <pre><code>namespace(:admin) do 
    resources :restaurants do
      resources :menus
      resources :menu_items
    end
  end
  </code></pre>
  
  <p>In the controller: </p>
  
  <pre><code>def new 
    @restaurant = Restaurant.find(params[:restaurant_id])
    @menu_item =  @restaurant.menu_items.build
  end
  </code></pre>
  
  <p>Trying to create a new MenuItem (action #new), by the url: <a href="http://127.0.0.1:3001/admin/restaurants/1/menu_items/new" rel="noreferrer">http://127.0.0.1:3001/admin/restaurants/1/menu_items/new</a> I get the error: </p>
  
  <pre><code>NoMethodError in Admin/menu_items#new
  
  Showing /home/fps/workspace3/peded/app/views/admin/menu_items/_form.html.erb where line #1 raised:
  
  undefined method `admin_menu_items_path' for #&lt;#&lt;Class:0xb6582d78&gt;:0xb6581f2c&gt;
  Extracted source (around line #1):
  
  1: &lt;%= form_for @menu_item do |f| %&gt;
  ...
  </code></pre>
  
  <p>How do I make this form work? It was created out of a nifty:scaffold</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I also tried this in the _form: </p>
  
  <pre><code>&lt;%= form_for [:restaurant, @menu_item] do |f| %&gt;
  </code></pre>
  
  <p>But ended with a similar error:</p>
  
  <pre><code>Showing /home/fps/workspace3/peded/app/views/admin/menu_items/_form.html.erb where line #1 raised:
  
  undefined method `restaurant_admin_menu_items_path' for #&lt;#&lt;Class:0xb68162b0&gt;:0xb6813dd0&gt;
  Extracted source (around line #1):
  
  1: &lt;%= form_for [:restaurant, @menu_item] do |f| %
  </code></pre>
  
  <p>Should I file a bug?</p>