# Drag and Drop Problems

**URL:** <https://www.ruby-forum.com/t/drag-and-drop-problems/135500>\
**Category:** Rails\
**Created:** [April 22, 2008, 6:32pm UTC](https://www.ruby-forum.com/t/drag-and-drop-problems/135500 "2008-04-22T18:32:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![newrubygirl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e274bd/32.png) [@newrubygirl](https://www.ruby-forum.com/u/newrubygirl)\
**Post date:** [April 22, 2008, 6:32pm UTC](https://www.ruby-forum.com/t/drag-and-drop-problems/135500/1 "2008-04-22T18:32:32Z")

</div>

I’m working with the Drag and Drop Example that appears in AWD and  
various other places. The problem that I’m having right now is that I  
can’t grab and drag my objects.

I get Javascript errors in Firebug that say Draggable is not defined and  
Droppables is not defined.

I’m hesitant to put up all of the code that it takes to make this all  
happen and thought I’d first ask if anyone else has had problems and  
could point me in a direction before putting up all of the code. I can  
post code here if needed, just let me know if only segments are needed  
or all of it.

Thanks!

---

<div class="post-metadata">

**Author:** ![newrubygirl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e274bd/32.png) [@newrubygirl](https://www.ruby-forum.com/u/newrubygirl)\
**Post date:** [April 22, 2008, 6:40pm UTC](https://www.ruby-forum.com/t/drag-and-drop-problems/135500/2 "2008-04-22T18:40:19Z")

</div>

sounds as if you didn’t include the javascripts for prototype &  
scriptaculous:

javascript\_include\_tag :defaults

in the header of your layout should do this

---

<div class="post-metadata">

**Author:** ![newrubygirl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e274bd/32.png) [@newrubygirl](https://www.ruby-forum.com/u/newrubygirl)\
**Post date:** [April 22, 2008, 6:58pm UTC](https://www.ruby-forum.com/t/drag-and-drop-problems/135500/3 "2008-04-22T18:58:36Z")

</div>

Thorsten M. wrote:

> javascript\_include\_tag :defaults
> 
> in the header of your layout should do this

Yep, that worked. Dumb error, I have different layouts and didn’t  
include it in the layout I was using.

Now I get new errors including Droppables has no properties and  
Draggable is not a constructor. Looks like I have new errors to  
resolve. If anyone has any thoughts on these, I would appreciate it.

---

<div class="post-metadata">

**Author:** ![newrubygirl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e274bd/32.png) [@newrubygirl](https://www.ruby-forum.com/u/newrubygirl)\
**Post date:** [April 22, 2008, 7:06pm UTC](https://www.ruby-forum.com/t/drag-and-drop-problems/135500/4 "2008-04-22T19:06:50Z")

</div>

I think that I’ve got it now. The code wasn’t updating and so now I’m  
set.
