Ruby on Rails 3.1 and jQuery UI images

前端 未结 18 1033
无人及你
无人及你 2020-12-12 11:50

I\'m using Ruby on Rails (Edge, the development version), and Ruby rvm 1.9.2.

application.js is as follows.

//= require jquery
//= requi         


        
18条回答
  •  盖世英雄少女心
    2020-12-12 12:33

    Building on a number of other suggestions here, I found a solution that works in my dev environment and in production on Heroku.

    app/assets/javascripts/application.js

    //= require jquery
    //= require jquery_ujs
    //= require jquery-ui
    //= require_tree .
    

    app/assets/stylesheets/application.css

    /*
     *= require_self
     *= require vendor
     *= require_tree .
    */
    

    vendor/assets/stylesheets/vendor.css

     /*
     *= require_self
     *= require_tree .
    */
    

    I added jquery-ui-1.8.16.custom.css and the associated images folder to vendor/assets/stylesheets (I found that unless the images folder was in the same folder as vendor.css it didn't work).

    No other changes were necessary for this to work in the Heroku production environment.

    Thanks to @denysonique, @softRli and @Paul Cook for their previous answers which helped me.

提交回复
热议问题