1
votes

I want to load an external stylesheet from app/vendor/assets/stylesheets/twitter... but Sprockets keeps complaining that the file can't be found. My app/assets/stylesheets/application.css looks like this:

/*
*= require_self
*= require bootstrap
*= require sass_main
*/

I tried adding the subdirectory to the asset path like this:

config.assets.paths << "#{Rails.root}/app/vendor/assets/stylesheets/twitter"

...but no luck. What I gotta do?

2
Could you please clarify if you need the whole directory or just a file in there?Pedro Nascimento

2 Answers

4
votes

Try:

/*
*= require_self
*= require bootstrap
*= require sass_main
*= require_directory ./twitter
*/
0
votes

If require_directory ./twitter did the trick then I believe the problem was in typo in your asset path:

Are you sure you were having /vendor dir under app/? Usually this sits in Rails.root so you were correct at the beginning by adding it to config.assets.paths but you should have left out the /app in between like this:

config.assets.paths << "#{Rails.root}/vendor/assets/stylesheets/twitter"