I have to be doing some thing very silly/stupid here. Been hitting my head all day trying to get jQueryUI to run in my Rails 4.2.1 application, and failed for some reason. Doesn’t seem like this should be that hard, I must be doing something stupid that I just can’t see.
I added this to the Gemfile:
gem 'jquery-ui-rails'
application.js
//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require twitter/typeahead
//= require bootstrap
//= require_tree .
application.css
*= require bootstrap
*= require bootstrap-theme
*= require font-awesome
*= require jquery-ui
*= require_self
*= require_tree .
Yet when I type in a window say:
$('input').draggable()
I get back:
TypeError: undefined is not a function (evaluating '$('input').draggable()')
I can see in my Resources list that the draggable model is loaded. I see that jQuery is loaded, and can run other jQuery functions. I’m doing something stupid I’m sure, please help!!!
2
Answers
I ran:
and everything seemed to work??? Can anyone explain this for the answer vote;-)
IIRC, there’s a typo in the
jquery-ui-rails
documentation that tells you to usejquery_ui
, even though the correct notation isjquery.ui
(note the dot, not underscore).Try this in your
application.js
:application.css
: