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)
toconfig/application.rb
- Add
config.assets.paths << Rails.root.join("vendor", "assets", "images")
toconfig/application.rb
Errors
The error messages thrown by DataTables js are the following:
- GET http://localhost:3000/vendor/assets/images/sort_both.png 404 (Not Found)
- GET http://localhost:3000/vendor/assets/images/sort_asc.png 404 (Not Found)