title: no route match rails 5
body: <p>am trying to add routes to my rails app but everytime i try to load the index page it returns no route match.
  my </p>
  
  <p><strong>product.rb</strong></p>
  
  <pre><code>belongs_to :category
  extend FriendlyId
  friendly_id :name, use: [:slugged, :finders]
   default_scope { where(active: true) }
  end
  </code></pre>
  
  <p>and here is my category.rb </p>
  
  <pre><code>has_many :products
    extend FriendlyId
   friendly_id :name, use: [:slugged, :finders]
  </code></pre>
  
  <p>and my routes are setup like this </p>
  
  <pre><code>    resources :categories
      get '/products/:category_id/:id/', to: 'products#show', as: 'product'
      resources :products
  </code></pre>
  
  <p>in my index page i have it like this</p>
  
  <pre><code>&lt;%= link_to product, class: "card" do %&gt;
  &lt;div class="product-image"&gt;
  &lt;%= image_tag product.productpic.url if product.productpic? %&gt;
      &lt;/div&gt;
  
        &lt;div class="product-text"&gt;
          &lt;h2 class="product-title"&gt; &lt;%= product.name %&gt;&lt;/h2&gt;
            &lt;h3 class="product-price"&gt;£&lt;%= product.price %&gt;&lt;/h3&gt;
        &lt;/div&gt;
  
          &lt;% end %&gt;
      &lt;% end %&gt;
  </code></pre>
  
  <p>but when ever i load the page in my broser i get </p>
  
  <pre><code>No route matches {:action=&gt;"show", :category_id=&gt;#&lt;Product id: 4, name: "virgin hair", price: #&lt;BigDecimal:7fd0af3ffb10,'0.3E3',9(18)&gt;, created_at: "2016-07-19 12:34:34", updated_at: "2016-07-19 12:41:36", slug: "virgin-hair", productpic: "longhair.jpg", pdescription: "this a brazilian virgin hair", active: true, category_id: 2&gt;, :controller=&gt;"products"} missing required keys: [:id]
  </code></pre>
  
  <p>what am i doing wrong here as i am a novice</p>