Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3.1 and jquery-ui assets

This was asked in another question, but none of the solutions appear to work for me in 3.1rc1.

I'm trying to use the new assets stuff in rails 3.1 - I have the files:

./vendor/assets/stylesheets/jquery-ui-1.8.13.custom.css ./vendor/assets/javascripts/jquery-ui-1.8.13.custom.min.js 

I then added:

//= require jquery-ui to app/assets/javascripts/application.js *= require jquery-ui to app/assets/stylesheets/application.css 

The jquery-ui javascript file loads just fine, but the css file says:

Sprockets::FileNotFound (couldn't find file 'jquery-ui'      (in /home/xanview2/xancar/app/assets/stylesheets/application.css):6): 

Any ideas?

like image 274
Roman Gaufman Avatar asked May 26 '11 04:05

Roman Gaufman


1 Answers

Example of a working setup:

    $ cat app/assets/javascripts/application.js      //= require jquery     //= require jquery-ui       $ cat app/assets/stylesheets/application.css      /*      *= require vendor      *      */       $ cat vendor/assets/stylesheets/vendor.css      /*      *= require_tree ./jquery_ui       *      */      vendor/assets/ $ tree      stylesheets          vendor.css              jquery_ui                       jquery-ui-1.8.13.custom.css                       ...      images         jquery_ui             ui-bg_flat_0_aaaaaa_40x100.png             ... 

Finally run this command:

    vendor/assets/images $ ln -s jquery_ui/ images 

Enjoy your jQuery UI

like image 54
denysonique Avatar answered Sep 29 '22 07:09

denysonique