Adding a background image in Ruby on Rails 2 in CSS

前端 未结 6 949
野趣味
野趣味 2020-12-07 19:08

I generated a scaffold in ruby and I want to insert a background image to every page on the site but Im not sure what the link to the image should be.

my image is

6条回答
  •  无人及你
    2020-12-07 19:45

    If you are using a modern version of rails (3.1 or later I believe), you can use:

    background: url('../dep.jpg');
    

    Since the css also lives in your assets folder .. automatically refers to the assets folder.

提交回复
热议问题