0

I am using the DataTables library in my Rails 4.2.1 application. I have manually included all of the assets that are required including 1 js file, 1 css file, and 3 images. The js and css are properly precompiling but the images are not.

Currently the three images are located in vendor/assets/images/<name>.png. They are not precompiling (which after some research is intentional in rails 4.0+) and after attempting all of the fixes I could find on SO I still cannot get these images properly loaded by the asset pipeline. I have tried the following fixes to no avail.

Attempted fixes

  • Move images to app/assets/images
  • Add config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif) to config/application.rb
  • Add config.assets.paths << Rails.root.join("vendor", "assets", "images") to config/application.rb

Errors

The error messages thrown by DataTables js are the following:

Steve
  • 836
  • 1
  • 9
  • 17
  • 1
    The first image should be accessible at http://localhost:3000/assets/sort_both.png. If that works, then there are probably incorrect hard-coded paths to the images in the css file. – ahmacleod Sep 17 '15 at 23:55
  • That was exactly it thank you. I'm still learning about the asset pipeline and where they become accessible. – Steve Sep 18 '15 at 01:56

0 Answers0