title: Rails: Update database based on DOM element / jQuery
body: <p>I am new to Rails and working on a quiz application, and am having trouble implementing the timer properly. When a user creates a new quiz, the controller calculates the time they are given based on the number of questions, 1 minute per question, and this is value is stored in the database. The user is then redirected to the first quiz question and the timer starts. They can choose a multiple choice answer, then click "Next" to go to the next question. The problem is that the page for the next question loads and the timer starts over instead of continuing where it left off on the previous page. </p>
  
  <p>The timer is in javascript. It is implemented in my view as a div:</p>
  
  <pre><code>    &lt;%= content_tag "div", class: "timer", data: {time: @time} do %&gt;&lt;% end %&gt;
  </code></pre>
  
  <p>I can access the current time in my .js.coffee file (such as when "Next" is clicked) with</p>
  
  <pre><code>    $(".timer").countdown("getTimes")
  </code></pre>
  
  <p>How can I send this time value to the Rails controller / database since it is a javascript/jQuery object?</p>
  
  <p>Or should I try a different approach altogether?</p>
  
  <p>Thanks!</p>