gpt4 book ai didi

css - 我的 .scss 不在我的 ruby​​ 应用程序中

转载 作者:行者123 更新时间:2023-11-28 08:29:10 26 4
gpt4 key购买 nike

我是 ruby​​ 开发的新手,如果我的问题一开始就不太准确,请提前致歉。

我尝试应用 css 样式,但我使用的方式并没有像我认为的那样工作。

来自家庭 Controller 的 index.html.erb app/views/home

<div class="box_home">
...
...
</div>

home.scss 应用程序/ Assets /样式表

.box_home { margin-bottom: 20px; }

application.scss 应用程序/ Assets /样式表

@import "bootstrap-sprockets";
@import "bootstrap";
body { padding-top: 50px; }
.box_home { margin-bottom: 20px; }

没有发生那样的事情。但是,如果我在 application.scss 中插入 css 属性,它就可以工作。

这是正确的做法还是应该在每个 Controller 的 scss 文件中分散样式?如果是,怎么办?

我试图找到文档或较早的问答,但我没有找到。

在此先感谢您的帮助。

最佳答案

您是否在 application.css 中需要此文件?

*= require home

关于css - 我的 .scss 不在我的 ruby​​ 应用程序中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28371213/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com