I am using Rails 3.1 and having an issue with the jQueryUI library. Here is my application.js
file:
//= require jquery
//= require jquery-ui
//= require jquery_ujs
// Loads all Bootstrap javascripts
//= require bootstrap
//= require rails.validations
//= require_tree .
It loads the "jquery ui" file into the browser, but whatever I use related to it it shows this error:
TypeError: Object function (a,b){return new d.fn.init(a,b,g)} has no method 'dialog'
I had the same problems, application.js
looked like this:
//= require jquery
//= require jquery_ujs
//= require jquery-ui
In development mode, it seems /assets/application.js
contained a version of jQuery bundled with ujs, and, when added to the page, it was like this:
<script src="jquery"></script>
<script src="jquery_ujs"></script>
<script src="jquery-ui"></script>
<script src="application.js"></script>
The last file was overriding the first three files. I put:
//= require_self
//= require jquery-ui
and it works fine.
The funny thing is, application.js
only contains require
lines, no jQuery or ujs.
You might have precompiled your assets at an earlier point.
Try to remove everything under public/assets
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With