# sortable\_element example

**URL:** <https://discuss.rubyonrails.org/t/sortable-element-example/33319>\
**Category:** rubyonrails-talk\
**Created:** [August 18, 2008, 5:37am UTC](https://discuss.rubyonrails.org/t/sortable-element-example/33319 "2008-08-18T05:37:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorg\_Lueke](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@Jorg\_Lueke](https://discuss.rubyonrails.org/u/Jorg_Lueke)\
**Post date:** [August 18, 2008, 5:37am UTC](https://discuss.rubyonrails.org/t/sortable-element-example/33319/1 "2008-08-18T05:37:45Z")

</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:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [August 18, 2008, 8:56pm UTC](https://discuss.rubyonrails.org/t/sortable-element-example/33319/2 "2008-08-18T20:56:31Z")

</div>

Jorg Lueke 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\_Lueke](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@Jorg\_Lueke](https://discuss.rubyonrails.org/u/Jorg_Lueke)\
**Post date:** [August 19, 2008, 12:25pm UTC](https://discuss.rubyonrails.org/t/sortable-element-example/33319/3 "2008-08-19T12:25:02Z")

</div>

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