title: how to make js the format of a rails form submitted via ajax?
body: <p>I have this form:</p>
  
  <pre><code>&lt;div id='relationship_&lt;%= relationship.id %&gt;'&gt;
    &lt;% @value_id = "value_#{relationship.id}" %&gt;
    &lt;% @div_slider_id = "slider_value_#{relationship.id}" %&gt;
    &lt;% @form = "edit_relationship_#{relationship.id}"%&gt;
    &lt;%= form_for(relationship, :remote =&gt; true) do |f| %&gt;
      &lt;div id="&lt;%= @div_slider_id %&gt;"&gt;&lt;/div&gt;
      &lt;%= f.hidden_field :value, :id =&gt; "#{@value_id}" %&gt;
    &lt;% end %&gt;
  &lt;/div&gt;
  
  &lt;script type='text/javascript'&gt;
  $(document).ready( function() {
    $(function() {
      $( "#&lt;%= @div_slider_id %&gt;" ).slider({
        orientation: "horizontal",
        range: "min",
        value: &lt;%= relationship.value || 1 %&gt;,
        min: 0,
        max: 100,
        change: function( event, ui ) {
          $( "#&lt;%= @value_id %&gt;" ).val( ui.value );
  </code></pre>
  
  <p>If the user moves the slider, the form is sent as HTML, not JS</p>
  
  <pre><code>        $("#&lt;%= @form %&gt;").submit();
        }
      });
      $( "#&lt;%= @value_id %&gt;" ).val( $( "#&lt;%= @div_slider_id %&gt;" ).slider( "value" ) );
    });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>How do I sent that form on JS format when I move the slider?</p>
  
  <p>thanks</p>