title: Need help passing the value of a jQuery UI Slider to a form using the hidden_field in Ruby on Rails
body: <p>I'm new to Rails so sorry for the extremely basic question. I'm trying to store the value of a jQuery UI Slider in my database when a form is submitted.  For other elements such as a text_area this can be done by 
  <code>&lt;%= f.text_area :my_score %&gt;</code> or for a date with datepicker (<a href="https://github.com/albertopq/jquery_datepicker" rel="nofollow">using the jQuery Datepicker Rails plugin</a>): <code>&lt;%= f.datepicker :my_date %&gt;</code>. However, I am having trouble finding a plugin for the slider and from my research it seems the best way is through the use of hidden_field.  However, I don't know the correct notation for taking the value of the slider and correctly passing it to the form.  Any help would be greatly appreciated.</p>
  
  <pre><code>&lt;div id="slider"&gt;&lt;/div&gt;
  &lt;input type="hidden" id="hidden"/&gt;
  &lt;%= f.hidden_field :my_score, :value =&gt; (what goes here?) %&gt;
  </code></pre>
  
  <p>Javascript for the slider:</p>
  
  <pre><code>&lt;script&gt;
  $(function() {
      $( "#slider" ).slider({
          value:100,
          min: 5,
          max: 200,
          step: 5,
          slide: function( event, ui ) {
              $( "#amount" ).val( ui.value );
          },
  
          change: function(event, ui) {
             $('#hidden').attr('value', ui.value);
             }
      });
      $( "#amount" ).val( $( "#slider" ).slider( "value" ) );
  });
  &lt;/script&gt;
  </code></pre>