title: Searching between two dates in rails activerecord
body: <p>I'm receiving a date in my parameters and searching the database to see if the date falls between start date and end date.  My code is the following.</p>
  
  <pre><code>    date = params[:date]
  
      record = Campaign.where(['start_date &lt; ? AND end_date &gt; ?', date, date])
  </code></pre>
  
  <p>This only returns each records name.  But when I try to access the full record, like its id, rails throws an error.  </p>
  
  <p>I don't understand what I'm doing wrong.</p>