Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6600967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:41:32+00:00 2026-05-25T18:41:32+00:00

I started a new RoR 3.1 project to test this. I’ve added the following

  • 0

I started a new RoR 3.1 project to test this. I’ve added the following needed jQuery .js files to make draggable work correctly into my app/assests/javascripts directory.

jquery.ui.core.js
jquery.ui.widget.js
jquery.ui.mouse.js
jquery.ui.draggable.js

The application.js has the default code:

//= require jquery
//= require jquery_ujs
//= require_tree .

I then added the .js code to make it all work into the application.js file:

$(function() {
  $( "#draggable" ).draggable();
});

So this is all set.

Then I use the following code in my home page:

<div id="draggable" class="ui-widget-content">
  <p>Drag me around</p>
</div>

Dragging doesn’t work! The code I used is based on the jQuery demo file for draggable. It works fine as a HTML file but when I put into my Ruby on Rails 3.1 project, it doesn’t work. What am I doing wrong? I’ve been pulling my hair because of this. Thanks for your help!

(Not i’ve removed css formatting to make my code look simplier. Its not because of that though)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:41:33+00:00Added an answer on May 25, 2026 at 6:41 pm

    You need to make sure the dependencies between jQuery UI files are preserved.

    Rails provides no guarantee of order. So you need to change your application.js to:

    //= require jquery
    //= require jquery_ujs
    //= require jquery.ui.core
    //= require jquery.ui.widget
    //= require jquery.ui.mouse
    //= require jquery.ui.draggable
    //= require_tree .
    

    Or alternatively you can use pakunok gem to do it automatically for you:

    //= require jquery
    //= require jquery_ujs
    //= require pakunok/jquery-ui/pack/draggable
    //= require_tree .
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I started a new WPF project in VS2008 and then added some code to
I started a new project this afternoon and now that I've decided to write
I'm new to RoR and started making a project recently. The project has public/stylesheets
I started a new job where I have to work with several project built
We started a new project and realized that we needed a general purpose javascript
We started a new project and the nature of the project is very interactive
I recently started a new webforms project and decided to separate the business classes
I have started a new mvc project and clicked on project\properties\web - use local
I have started a new web application and have decided to use jquery as
I have just started a new project, and I am using the Delphi 2009

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.