# Drag and drop tutorials/examples?

**URL:** <https://www.ruby-forum.com/t/drag-and-drop-tutorials-examples/60548>\
**Category:** Rails\
**Created:** [May 15, 2006, 2:34pm UTC](https://www.ruby-forum.com/t/drag-and-drop-tutorials-examples/60548 "2006-05-15T14:34:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![n1c](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3ec8ea/32.png) [@n1c](https://www.ruby-forum.com/u/n1c)\
**Post date:** [May 15, 2006, 2:34pm UTC](https://www.ruby-forum.com/t/drag-and-drop-tutorials-examples/60548/1 "2006-05-15T14:34:48Z")

</div>

Just finished our first proper rails app and I’m trying to add some AJAX  
effects for the first time. I’ve got Rails Recipes and the Rails  
Cookbook, none of their examples seem to be a good fit with what I’m  
trying to achieve. Which is…

I have 2 lists of users. One for assigned users, one for unassigned  
users. I want to be able to drag users between the lists to either  
assign or unassign them.

Pointers? Can anyone suggest some good tutorials or example code?

Thx  
Nick

---

<div class="post-metadata">

**Author:** ![n1c](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3ec8ea/32.png) [@n1c](https://www.ruby-forum.com/u/n1c)\
**Post date:** [May 15, 2006, 4:11pm UTC](https://www.ruby-forum.com/t/drag-and-drop-tutorials-examples/60548/2 "2006-05-15T16:11:56Z")

</div>

Check out the scriptaculous sortables demo:

[http://wiki.script.aculo.us/scriptaculous/show/SortableListsDemo](http://wiki.script.aculo.us/scriptaculous/show/SortableListsDemo)

Michael

---

<div class="post-metadata">

**Author:** ![n1c](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3ec8ea/32.png) [@n1c](https://www.ruby-forum.com/u/n1c)\
**Post date:** [May 15, 2006, 5:04pm UTC](https://www.ruby-forum.com/t/drag-and-drop-tutorials-examples/60548/3 "2006-05-15T17:04:29Z")

</div>

Michael T. wrote:

> Check out the scriptaculous sortables demo:
> 
> [http://wiki.script.aculo.us/scriptaculous/show/SortableListsDemo](http://wiki.script.aculo.us/scriptaculous/show/SortableListsDemo)
> 
> Michael

That’s pretty much what I’m after. Unfortunately rails’ sortable\_element  
doesn’t seem to support dragging to another container. What’s the  
workaround?

thx  
Nick

---

<div class="post-metadata">

**Author:** ![n1c](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3ec8ea/32.png) [@n1c](https://www.ruby-forum.com/u/n1c)\
**Post date:** [May 16, 2006, 11:51am UTC](https://www.ruby-forum.com/t/drag-and-drop-tutorials-examples/60548/4 "2006-05-16T11:51:08Z")

</div>

On Mon, 2006-05-15 at 17:04 +0200, Nick C. wrote:

> Michael T. wrote:
> 
> > Check out the scriptaculous sortables demo:
> > 
> > [http://wiki.script.aculo.us/scriptaculous/show/SortableListsDemo](http://wiki.script.aculo.us/scriptaculous/show/SortableListsDemo)
> > 
> > Michael
> 
> That’s pretty much what I’m after. Unfortunately rails’ sortable\_element  
> doesn’t seem to support dragging to another container. What’s the  
> workaround?

The workaround is reading the documentation, especially the containment  
section at  
[http://wiki.script.aculo.us/scriptaculous/show/Sortable.create](http://wiki.script.aculo.us/scriptaculous/show/Sortable.create)

## ( :containment =\> [‘sortable\_id\_1’, ‘sortable\_id\_2’] )

Erlend S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
