[英]In Rails 6: Parallax works in development but not in production
The following code works in development but not in production and I'm at a loss.以下代码适用于开发但不适用于生产,我不知所措。 I'm currently deploying production to AWS with capistrano:我目前正在使用 capistrano 将生产部署到 AWS:
.container_parallax {
text-align: center;
background-image:url(background1.jpg);
background-repeat:no-repeat;
background-size:cover;
background-attachment: fixed;
font-family:helvetica, arial, sans-serif;
line-height:20px;
min-height: 90vh;
}
The image background1.jpg
is in the proper directory app/assets/images/
.图像background1.jpg
位于正确的目录app/assets/images/
。
Thanks in advance for any assistance!在此先感谢您的帮助!
I fixed the problem by making the following change background-image: asset-url('background1.jpg');
我通过进行以下更改background-image: asset-url('background1.jpg');
解决了这个问题background-image: asset-url('background1.jpg');
. .
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.