title: Rails 3.2.1 - Getting Javascript variables/data to Rails Controller
body: <p>I'm working on a <code>Rails 3.2.1</code> app and would like to pass some Javascript variables to the Rails controller.  Here are some more details:</p>
  
  <p>my js fiddle: <a href="http://jsfiddle.net/PauWy/475/" rel="nofollow">http://jsfiddle.net/PauWy/475/</a></p>
  
  <p>and what fiddle doesn't show, a jQuery UI sortable:  <code>$("#menu-items").sortable();</code></p>
  
  <p>I would like to work with the following information in my Rails 'execute' method in the ThingsController for each item:</p>
  
  <ol>
  <li>Whether or not the item is visible   (I think I should do something like $('#item_1).is(':visible')</li>
  <li>Which one of the following is displayed - "Add", "Reduce", or neither</li>
  <li>the id of the item</li>
  <li>the order/position of the item in the sortable list</li>
  </ol>
  
  <p>My take would be to send an AJAX with the above data to the 'things/execute' action, and somehow route it and respond_to the incoming AJAX.</p>
  
  <p>I know vaguely how some bits and pieces should look like, but I'm having a hard time putting everything together.  Would really appreciate some help!</p>