How can I reference CSS background images in production in Rails 4.0?

后端 未结 1 2018
耶瑟儿~
耶瑟儿~ 2021-02-06 00:20

I switched an app over from 3.2.12 to 4.0.0.rc1. When I viewed it in production afterwards, the background image had disappeared. The rest of my image assets were fetched with n

1条回答
  •  长发绾君心
    2021-02-06 00:38

    Use asset-url. Rails will preprocess this and expand the proper url.

    body {
      background-image: asset-url('background.png');
      background-attachment: fixed;
      background-position: 100% 100%;
      background-repeat: no-repeat;
    }
    

    0 讨论(0)
提交回复
热议问题