sass-rails helpers “image-url”, “asset-url” are not working in rails 3.2.1

后端 未结 9 2094
一整个雨季
一整个雨季 2020-12-12 20:36

I am on 3.2.1, with sass-rails-3.2.4 and sass-3.1.15...

The documentation for the asset pipeline says:

asset-url(\"rails.png\", image) becomes url(/a         


        
9条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-12 21:11

    Despite what the documentation says, it seems the default options in rails 3.2.6 allow you to just make things work with even less path information in your CSS. E.g. ../app/assets/images/rails.png is references in your example.css.scss file with something like:

    background: white url(rails.png) repeat-y;

    You don't include the image-url or asset-url into your scss (as far as I know), just plain url(your_image.png). That bit of documentation appears to be just an explanation of what it is doing in the background.

提交回复
热议问题