title: Rails filter index results by using a link (without dropdown)
body: <p>If a user selects a predefined filter link, how would my index show results based on that request?</p>
  
  <pre><code>&lt;h1&gt;Products&lt;/h1&gt;
  &lt;% @products.each do |product| %&gt;
  &lt;%= link_to product.name, product_path(product) %&gt;
  &lt;% end %&gt;
  
  &lt;h2&gt;Find Product by Category&lt;/h2&gt;
  Electronics
  Apparel
  Books
  </code></pre>
  
  <p>For example, how would I make "Electronics" link to filter the products index to only include products with an "Electronics" category? The "category" field/column is already defined in my database/model.</p>
  
  <p>This is currently what my controller looks like:</p>
  
  <pre><code>def index
    @products = Product.all
  end
  </code></pre>
  
  <p>Thanks.</p>