title: Ruby on Rails - Passing values to a link_to
body: <p>I'm a RoR beginner and am using Rails 3.2.3.</p>
  
  <p>I have a search form on my page and it performs a get request and filters the results correctly.</p>
  
  <p>I want to add the possibility of also searching Products by dates.
  I inserted a date_select and am able select the date and when the page refreshes after the search, the chosen dates are still there on the date_select, as I am able to get them through <code>params</code>.</p>
  
  <p>However, my issue is that when the page renders the products, they have a link_to to their show action.
  My goal is to also pass alongside the url the dates that were selected to perform the search on that link_to.</p>
  
  <p>For ex, if the user selects a date of 20-06-2012 to 25-06-2012 it only shows products inserted on that time frame (and all those params are on the url)</p>
  
  <p>But the link to show action of each displayed product is only:</p>
  
  <pre><code>link_to &lt;%= link_to product.name, product%&gt;
  </code></pre>
  
  <p>which renders</p>
  
  <p><code>http://localhost:3000/products/24</code> (por example)</p>
  
  <p>what I want to render/show is something like:</p>
  
  <pre><code>http://localhost:3000/products/24?from=20-06-2012&amp;to=25-06-2012
  </code></pre>
  
  <p>The selected dates to perform the search are not stored in the database at this moment, but I will need to get them from the URL on a latter page, therefore, both dates will need to be preserved through 2 different pages before the users fills a form and then those dates are inserted in the DB.</p>
  
  <p>Any tips on this? I've searched but all I found was on how to pass variables that exist in the model and I do not want to use cookies nor session variables.</p>
  
  <p>Thanks in advance,
  Regards</p>