How to set background-image in Rails

Hash tags: Ruby on Rails CSS

This one will be very short.

When Sprokets compiling images following won't work on rails production server:
body {
 background-image: url("paper.gif");
}
It will return 500 error due to "Can't find image"

Quick Fix by using embedded ruby:
style="background-image: url(<%= asset_path "paper.gif" %>);

PROJECTS


MORE BLOGS