title: Getting an error when trying to associate a menu to a restaurant rails
body: <p>I've been struggling the past few days trying to get a basic restaurant website up. The website will be listing a bunch of restaurants and each of them will have a menu. </p>
  
  <p>My menu association </p>
  
  <pre><code>class Menu &lt; ActiveRecord::Base
      belongs_to :store
  end
  
  class Store &lt; ActiveRecord::Base
      has_one :menu
  end
  </code></pre>
  
  <p>My routes for now is:</p>
  
  <pre><code>Rails.application.routes.draw do
  
  
    resources :stores do
      resources :menus
  
    end
  
  root 'stores#index'
  </code></pre>
  
  <p>I did the migration for adding references to stores. The problem occurs when I try to create a link_to button for adding a new menu in the restaurant show page. </p>
  
  <pre><code>&lt;%= link_to 'Create menu', new_store_menu_path %&gt;
  </code></pre>
  
  <p>This gives me the error when I try to load the show.html.erb</p>
  
  <pre><code>No route matches {:action=&gt;"new", :controller=&gt;"menus", :id=&gt;"1"} missing required keys: [:store_id]
  </code></pre>
  
  <p>Thanks all!</p>