Sortable_element does not initiate AJAX calls


#1

Having an odd problem with sortable_element. The :url option doesn;t
seem to actually work. No AJAX calls are being generated. I can tell
because Firebug extension does not show any AJAX requests, and the
development.log file does not do anything when droppping the items in
new positions.

Here is the code I am using for sortable generation:

<%= sortable_element ‘images’,
:url => {
:action => ‘reorder_images’,
:id => @product
},
:overlap => :horizontal,
:constraint => false,
:tag => :div
%>

Which generates the following javascript:

the onUpdate portion of the sortable looks correct, but no AJAX
requested is created. The sortable_elements pieces are draggable and
dropppable, and I can reorder any way I please, but with no way to save
it’s kind of moot.

Has anyone else managed to get this working? Am I missing something
stupid? Is this a bug in prototype/scriptaculous?


#2

Alex W. wrote:

Having an odd problem with sortable_element. The :url option doesn;t
seem to actually work. No AJAX calls are being generated. I can tell
because Firebug extension does not show any AJAX requests, and the
development.log file does not do anything when droppping the items in
new positions.

found the solution here: http://www.ruby-forum.com/topic/66894

Apparently, the sortable elements must have an id in the proper format
or Sortable.serialize just silently fails aborting the AJAX call. The
proper id format is:

a
b

There should really be a javascript error thrown if Sortable.serailze
fails.