March 29

0 comments

Artisteer templates with Ruby on Rails – Header and graphics not showing – solution

By Christopher Mendla

March 29, 2016

Artisteer

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’);

The solution was to remove the images/ prefix so that the references appeared as:
content:url(‘blockbullets.png’);
After I made the changes, about 40 in all, I did a  rake assets:precompile and the header images were showing as expected.
I also added the following to assets.rb


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 )

as well as adding the following to application.js

//= require script
//= require script.responsive

Now the template is working as expected

Christopher Mendla

About the author

Leave a Reply

Your email address will not be published. Required fields are marked

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}