I've found several different threads on including assets in the vendor/assets
directory but did not find anything that worked for me. Previously, I had all of my vendor assets in the app/
directory but moved the JavaScript to the vendor/assets/javascripts/
directory and the CSS to the vendor/assets/stylesheets/
directory.
I'm now trying to load my vendor assets both in development and production, and they're not loading at all. Here's my assets.rb
file:
# Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path
# Rails.application.config.assets.paths << Emoji.images_path
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
Rails.application.config.assets.precompile += [
Rails.root.join('vendor/assets/javascripts/*').to_s,
Rails.root.join('vendor/assets/stylesheets/*').to_s
]
I've also tried adding the vendor/assets/
directories to Rails.application.config.assets.paths
, and that didn't help.
How can I include all of the vendor assets in the asset pipeline?
UPDATE
I got my vendor JavaScript to load by adding the following to app/assets/javascripts/application.js
:
//= require_tree ../../../vendor/assets/javascripts/.
However, I'm using Sass and am still not able to get the SCSS files to load.
config.assets.paths << Rails.root.join('vendor', 'assets')
– Woolfell