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?
Add a comment
|
2 Answers
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