Forum: Ruby on Rails Problem with using

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
6fa14cea0167256804121f81c33d5fbb?d=identicon&s=25 vikki (Guest)
on 2007-05-15 06:55
(Received via mailing list)
HI everybody,

I'm newbie to rails application.
I like to use script in my app.

In that I can't drag the items using script.

This is the code I used inside my .rhtml file.

  <script src="javascripts/prototype.js" type="text/javascript"></
  <script src="javascripts/scriptaculous.js" type="text/javascript"></
  <script src="javascripts/effects.js" type="text/javascript"></script>


<b> Effects </b>

  <div onclick="new Effect.SwitchOff(this)">
    Click here if you've seen enough.

<div onclick="new Effect.SwitchOff(this)">
    Click here if you've seen enough.

<b> Drag and Drop </b>

<div id="dragDIV" >drag</div>
<%= javascript_tag "new Draggable('dragDIV')" %>

<div id="helperDIV" class="green box">helper</div>
<%= draggable_element :helperDIV %>


And i have the files scriptaculous.js, builder.js, effects.js,
dragdrop.js, controls.js and
slider.js and prototype.js in my app/public/javascripts/

<b> Effects </b> is working well. But <b> Drag and Drop </b>  is only
not working well. I cant drag the the above things.  And in my
development.log its fetch the above 6 javascripts. I mean it includes
the .js files into my app. But still its not working. Any other
suggestion. Or I missed any code to enable the drag function.

813f535246722b7bf02aacc9ce818de8?d=identicon&s=25 Bob Showalter (Guest)
on 2007-05-15 15:21
(Received via mailing list)
On 5/15/07, vikki <> wrote:
> This is the code I used inside my .rhtml file.
> </head>
Looks like you forgot dragdrop.js

I suggest you use the Rails helper to pull in the scripts:

  <%= javascript_include_tag :defaults %>

That pulls in all the prototype and scriptaculous scripts, so you
don't forget anything.
This topic is locked and can not be replied to.