title: How to pass an instance of an object via link_to (Date as example)
body: <p>I have  a Rails view that produces a HTML report based on the user having selected a date range of the report - and all is good with that.</p>
  
  <p>If the users likes what they see, there's a button to export that same report as csv.</p>
  
  <p>My problem is how to conveniently pass the date range previously selected by the user.  I've read various stackoverflow questions/answers about passing parameters via link_to, and this works somewhat, but the date is sent as a text string, and what I really need is for the date to be passed as a Date object.</p>
  
  <p>Here's my current link_to, which passes the date params as strings:</p>
  
  <pre><code>&lt;%= link_to image_tag("Buttons/ExportReport.png", :border =&gt; 0),
        export_sales_path(:start =&gt; @start_date,
                          :end =&gt; @end_date,
                          :sales =&gt; @items) %&gt;
  </code></pre>
  
  <p>I'd appreciate it if someone could tell me how to pass an instance of an object via link_to.</p>
  
  <p>Thanks for reading.</p>