Skip to content

Instantly share code, notes, and snippets.

@v-fedorov
Created June 4, 2013 17:55
Show Gist options
  • Save v-fedorov/5708020 to your computer and use it in GitHub Desktop.
Save v-fedorov/5708020 to your computer and use it in GitHub Desktop.
update: (e, ui) ->
item_id = ui.item.data('item_id')
position = ui.item.index()
$.ajax(
type: 'POST'
url: $(this).data('update_url')
dataType: 'json'
# the :thing hash gets passed to @thing.attributes
# row_order is the default column name expected in ranked-model
data: { id: item_id, thing: { row_order_position: position } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment