Last Updated on November 30, 2019 by Christopher G Mendla
I was creating a Ruby on Rails site and used Artisteer 4.3 to generate the template.
Even though I included the precompile directives in assets.rb, I was still not seeing the images for the header and some other images. I tried a rake assets:clobber / rake assets:precompile but that didn’t help.
The problem was that the references in style.css to images were in the form of
content:url(‘images/blockbullets.png’);
Rails.application.config.assets.compile = true #for Production
Rails.application. config.assets.precompile = [‘*.js’, ‘*.css’, ‘*.css.erb’] #for Production
Rails.application.config.assets.precompile += %w[*.png *.jpg *.jpeg *.gif] #for Production
Rails.application.config.assets.precompile += %w(script.js)
Rails.application.config.assets.precompile += %w(script.responsive.js)
Rails.application.config.assets.precompile += %w( style.css )
Rails.application.config.assets.precompile += %w( style.responsive.css )
Rails.application.config.assets.precompile += %w( style.ie7.css )
//= require script
//= require script.responsive
Now the template is working as expected