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?

0

2 Answers 2

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

Sign up to request clarification or add additional context in comments.

Comments

0
background-image: url(/assets/image.png);

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.