I've been trying to get jQueryUI tabs to work on my Rails 3.1 application, but I always end up getting.
I am loading jQuery and jQueryUI from the
jquery-rails gem manualy in my
#= require jquery #= require jquery-ui #= require jquery_ujs # more requires ... jQuery -> // regular jQuery stuff
Siempre consigo el
TypeError: Object [object Object] has no method 'tabs' as if jQueryUI wasn't loaded properly. Even if I try it in the console
I've checked contents of the
jquery-rails gem and it is there
Why isn't jQueryUI being loaded properly? Do I still need to set something in the app config to make it load jQueryUI? Is there any way I can check when it is being loaded and from where?
I checked the jQueryUI file itself and it actually does contain the tab definition ... proof:
preguntado el 01 de febrero de 12 a las 14:02
In config/environments/development.rb ( or the environment file you want to edit)
# Expands the lines which load the assets config.assets.debug = true
Also, check if jquery is being defined twice. In this case, the $ variable gets redefined and overridden and the apis might not be available in the new definition binding.
I had this problem with tabs and was going bananas. It turned out I needed to precompile my assets:
RAILS_ENV=production bundle exec rake assets:precompile
This fixed it for me. (I think removing contents of the public/assets folder as mentioned in the answer above would have worked, also.)