title: Canonical url tag added in application.html.erb file is not working on all the pages
body: <p>For SEO reasons I added <code>canonical</code> tag to the <code>application.html.erb</code> in the rails layouts, thinking all the urls being generated will have their own respective canonical url. But I checked it after pushing it to production. It doesn't seem like the <code>canonical</code> tag is working properly.</p>
  
  <p>Following is the <code>canonical</code> tag added in my <strong>application.html.erb</strong></p>
  
  <p><code>&lt;link rel="canonical" href="&lt;%= url_for(:only_path =&gt; false) %&gt;" /&gt;</code></p>
  
  <p>When I checked on a online canonical checker, only the home page/root_url has a proper canonical url:</p>
  
  <p>Page Url: <code>https://example.com/</code></p>
  
  <p>Canonical url: <code>https://example.com/</code></p>
  
  <p>Now when it comes to other landing pages, it is not working properly:</p>
  
  <p>Issues 1:</p>
  
  <p>Page url: <code>https://example.com/search?category_id=metal-processing-and-machine-tool</code></p>
  
  <p>Canonical url: <code>https://example.com/search</code>. </p>
  
  <p>Issue 2:</p>
  
  <p>Page url: <code>https://example.com/equipment_details/transformer-1250-kva-11-440-volts</code></p>
  
  <p>Canonical Url: <strong>NONE</strong></p>
  
  <p>This might cause a issue in SEO ranking. Could somebody please tell me how can I fix this ?</p>