Navigation
CATEGORY: Rails

jQuery UI images not showing in Rails 4

I recently upgraded an app to rails 4 from version 3.2 and noticed the images for the jQuery UI widgets were no longer showing in the production environment. They still showed up when I was in the development environment though. I did some googling and found out the reason the images are no longer showing is because Rails 4 no longer precompiles images in the assets folder.

I found a couple solutions on Stack Overflow to fix the issue, but they both required making a config change and manually updating the css file for jQuery UI.

Fortunately I found an easier solution that does not involve making any changes to the config nor to the css file.

The jQuery UI files were in the vendor assets folder, and the file structure looked like this:

/vendor
  /assets
    /stylesheets
      /jquery-ui
        /images
        jquery-ui.css

All I did was move the images folder from vendor/assets/stylesheets/jquery-ui/images to public/assets/jquery-ui/images

/public
  /assets
    /jquery-ui
      /images

And now the jQuery UI images are showing again.

There are no more results.