1

Im using the jquery-ui-rails (https://github.com/joliss/jquery-ui-rails) gem in my rails 3.2.13 project. In my application.js i have

application.js

//= require jquery-ui 

And in vendor/assets/javascripts/jquery-ui.js

//= require jquery.ui.all

application.css

*= require jquery-ui

And in vendor/assets/stylesheets/jquery-ui.css

 *= require jquery.ui.all

But icons are not showing for example, ui-icon-search does not show the search icon. How can i fix this ?

Thanks

3
  • 1
    Have you got any CSS code for the icons? Dec 13, 2013 at 9:57
  • In the browser i see a jqueury.ui.theme.css which contains the css for icons
    – jimcgh
    Dec 13, 2013 at 10:20
  • Thanks! Can you explain how you're trying to use the icons? Are they meant to appear in some of the JQuery UI elements? Dec 13, 2013 at 10:33

1 Answer 1

0

This turned out to be a paths issue with the jquery-ui images path

  • the css file looks for images at url(images/...)
  • when assets are precompiled, application.css gets moved to the top level
  • but images are in the /images dir

I solved by:

  • moving the jquery-ui css file to the top level
  • updating its calls to images by prepending the theme dir name
  • ie, url(my-theme-name/images/....)

Now it works both in dev and production.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.