# Sortable\_element :onUpdate

**URL:** <https://www.ruby-forum.com/t/sortable-element-onupdate/113309>\
**Category:** Rails\
**Created:** [August 29, 2007, 6:56pm UTC](https://www.ruby-forum.com/t/sortable-element-onupdate/113309 "2007-08-29T18:56:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcbey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d9b06d/32.png) [@marcbey](https://www.ruby-forum.com/u/marcbey)\
**Post date:** [August 29, 2007, 6:56pm UTC](https://www.ruby-forum.com/t/sortable-element-onupdate/113309/1 "2007-08-29T18:56:19Z")

</div>

First time poster - hope I’ve done sufficient homework to get more than  
an  
rtfm:

In my view, I have a

 list wherein each list element is identified  
with  
an id, thusly:
 \<% for task in @tasks %\> - \<%= task.Description %\> 
 \<% end %\>

Next I have a sortable that is intended to make a callback after things  
are  
updated:

\<%= sortable\_element :todoHandle, :handle =\> ‘handle’ ,  
:containment =\>  
[‘newHandle’,‘todoHandle’,‘doneHandle’,‘trashHandle’],  
:dropOnEmpty =\> true,  
:onUpdate =\> ??? %\>

What I would like to understand is how to define an action which may be  
called from onUpdate in order to resequence the tasks (in the database).

Most grateful for clues.

Thanks,

Marc
