# Sortable\_element example

**URL:** <https://www.ruby-forum.com/t/sortable-element-example/146117>\
**Category:** Rails\
**Created:** [August 18, 2008, 7:38am UTC](https://www.ruby-forum.com/t/sortable-element-example/146117 "2008-08-18T07:38:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorg\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/76d3ee/32.png) [@Jorg\_L](https://www.ruby-forum.com/u/Jorg_L)\
**Post date:** [August 18, 2008, 7:38am UTC](https://www.ruby-forum.com/t/sortable-element-example/146117/1 "2008-08-18T07:38:47Z")

</div>

Does someone have a good example of using sortable\_element and then  
updating the changed position in the database? I don’t have an issue  
getting the drag and drop to work, but saving the changes seems to be  
a challenge.

---

<div class="post-metadata">

**Author:** ![Jorg\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/76d3ee/32.png) [@Jorg\_L](https://www.ruby-forum.com/u/Jorg_L)\
**Post date:** [August 18, 2008, 10:56pm UTC](https://www.ruby-forum.com/t/sortable-element-example/146117/2 "2008-08-18T22:56:31Z")

</div>

Jorg L. wrote:

> Does someone have a good example of using sortable\_element and then  
> updating the changed position in the database? I don’t have an issue  
> getting the drag and drop to work, but saving the changes seems to be  
> a challenge.

No idea about sortable\_element but the operation is trivial with  
acts\_as\_list plugin by DHH himself…

hth

ilan

---

<div class="post-metadata">

**Author:** ![Jorg\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/76d3ee/32.png) [@Jorg\_L](https://www.ruby-forum.com/u/Jorg_L)\
**Post date:** [August 19, 2008, 2:25pm UTC](https://www.ruby-forum.com/t/sortable-element-example/146117/3 "2008-08-19T14:25:47Z")

</div>

On Aug 18, 3:56 pm, Ilan B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Jorg L. wrote:
> 
> > Does someone have a good example of using sortable\_element and then  
> > updating the changed position in the database? I don’t have an issue  
> > getting the drag and drop to work, but saving the changes seems to be  
> > a challenge.
> 
> No idea about sortable\_element but the operation is trivial with  
> acts\_as\_list plugin by DHH himself…

I do use both. The tricky piece was getting the right params back  
into the controller at the right moment. All is well now.
