I'm working on a Rails 3.2.1
app and would like to pass some Javascript variables to the Rails controller. Here are some more details:
my js fiddle: http://jsfiddle.net/PauWy/475/
and what fiddle doesn't show, a jQuery UI sortable: $("#menu-items").sortable();
I would like to work with the following information in my Rails 'execute' method in the ThingsController for each item:
- Whether or not the item is visible (I think I should do something like $('#item_1).is(':visible')
- Which one of the following is displayed - "Add", "Reduce", or neither
- the id of the item
- the order/position of the item in the sortable list
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.
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!