title: No route matches {:action=>"show", :controller=>"products"}, missing required keys: [:id]
body: <p>I have a rSpec Controller test which fails</p>
  <p>the index route will have an <code>:id</code> which does not exist in an index route.</p>
  <p>I've clean routes:</p>
  <p><code>resources :products</code></p>
  <p>This is the controller,</p>
  <pre class="lang-rb prettyprint-override"><code>class ProductsController &lt; ApplicationController
    before_action :set_product, only: [:show]
    skip_before_action :authorize_request, only: [:show, :index]
  
    # GET /products
    def index
      # params here {&quot;controller&quot;=&gt;&quot;products&quot;, &quot;action&quot;=&gt;&quot;index&quot;, &quot;product&quot;=&gt;{}}
      @products = Product.all
  
      render json: @products
    end
  </code></pre>
  <pre><code>ActionController::UrlGenerationError: No route matches {
  :action=&gt;&quot;show&quot;, 
  :controller=&gt;&quot;products&quot;}, 
  missing required keys: [:id]
  </code></pre>
  <p>Why is &quot;show&quot; called? I did not passed any params to the controller:
  This is the spec:</p>
  <pre class="lang-rb prettyprint-override"><code>
  RSpec.describe &quot;/products&quot;, type: :request do
  
    describe &quot; GET /index&quot; do
      it &quot; renders a successful response &quot; do
        Fabricate.times(3, :product)
        get &quot;/products&quot;, headers: valid_headers
        expect(response).to be_successful
      end
    end
  end
  </code></pre>
  <p>When I change the routes from <code>get &quot;/products&quot;, to: 'products#index'</code> and comment out <code>resources :products</code> then it passes the test</p>
  <p><strong>EDIT / PROBLEM FOUND :</strong></p>
  <p>I use <code>include Rails.application.routes.url_helpers</code> in my Product model, which caused this issue. I need it to generate URLs to retrieve my attachments. How else can I get the URLs of <code>ActiveStorage</code> ?</p>