Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Joe Bruno
35,909 PointsRuby on Rails & CSS background-image: url();
I am working on a project using Ruby on Rails. Within all of my html.erb pages, I have no problem embedding images: src="/assets/Pricing-17.png." No issues there. However, whenever I try to access an image from a css or scss file, I cannot retrieve the image! The path is app/assets/images/Pricing-17.png. I cannot find a path (I've tried the public folder and the assets folder!) that works using background-image: url(); or ruby's image_tag option. Any suggestions?
1 Answer
Joe Bruno
35,909 Pointsbackground: url("Pricing-17.png); worked
Charles Corey
1,340 PointsCharles Corey
1,340 Pointsbody{ background: url("Pricing-17.png"); }
Just added a closing quote"