I am trying to drag a div into a specific drop zone. From this I would like to post to my server the ID of the dragged div.
My code looks like this
function handleDropEvent( event, ui ) {
ui.draggable.position( { of: $(this), my: 'left top', at: 'left top' } );
$.ajax({
type: 'post',
data: ui.draggable.attr('id'),
dataType: 'script',
url: '/users/sort'
})
}
I am getting this from my post values
user_2 => nil
When I want this such that I can process it.
user => user_2
Try this: