我的整个rails应用程序只从一个文件获取css为什么

我为这两个控制器添加了不同的css文件,但我的整个应用程序只从product.css获取css

我为这两个控制器添加了不同的css文件,但我的整个应用程序只从product.css获取css我为这两个控制器添加了不同的css文件,但我的整个应用程序只从product.css获取css

products.css

 body { font-size: 11px; font-family: 'Open Sans', sans-serif; color: #4A4A4A ; text-align: center; } .wrap { background: #fff; margin: 20px auto; display: block; width: 300px; height: 380px; padding:20px; border-radius: 2px 2px 2px 2px; -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset; -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset; float: left; margin-right: 29px; } .wrap img { width: 100%; margin-top: 15px; } p{ margin-top: 15px; text-align: justify; } h1{ font-size: 20px; font-weight: bold; margin-top: 5px; text-shadow: 1px 1px 3px rgba(0,0,0,0.3); } a{ text-decoration: none; color: #4A4A4A !important; } a:hover{ text-decoration: underline; color: #6B6B6B !important ; } 

**

好的,你使用SCSS与CSS混合,我的建议是将product.css更改为product.scss并使用导入路径

  @import '/*'; @import '/**/*'; 

根据您的文件夹结构,如果找不到任何文件,rails会抛出错误,因为rails没有获取scss文件。

你也可以删除所有资产管道的东西并做@import’font-awesome’;