Files
grecia/app/assets/javascripts/sortable.js.coffee
Javi Martín d963657e41 Use spaces around curly braces in CoffeeScript
Just like we do in Ruby.
2019-03-05 21:38:36 +01:00

10 lines
300 B
CoffeeScript

App.Sortable =
initialize: ->
$(".sortable").sortable
update: (event, ui) ->
new_order = $(this).sortable('toArray', { attribute: 'data-answer-id' });
$.ajax
url: $('.sortable').data('js-url'),
data: { ordered_list: new_order },
type: 'POST'