1

I'm trying to load the images in a Ruby on Rails WebApp. But I'm not able to do so. How is the Assets Pipeline is used in Ruby on Rails? Suppose I'm trying to load an image as a background like: background: #FFC000 url(image.png) repeat; in my CSS but I'm getting problem. I've the images directory inside app/assets/images. Can anyone help me?

CodeGeeky
  • 453
  • 1
  • 5
  • 15

2 Answers2

2

Try with:

background: #FFC000 url('/assets/image.png') repeat;

or if you'll use SASS:

background: #FFC000 url(image_path("image.png")) repeat;

Check this answer: Adding a background image in Ruby on Rails 2 in CSS

Community
  • 1
  • 1
Zippie
  • 6,018
  • 6
  • 31
  • 46
0
background-image: url(/assets/image.png);
RajG
  • 832
  • 2
  • 15
  • 26