css - Rails5没有路线匹配[GET]“/bootstrap/css/bootstrap.min.css”
问题描述
我在下面写一个页面:
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Shop Homepage - Start Bootstrap Template</title>
<!-- Bootstrap core CSS -->
<link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="/shop-homepage.css" rel="stylesheet">
</head>
我得到了这个错误:
Started GET "/shop-homepage.css" for ::1 at 2020-11-22 17:21:15 +0800
Started GET "/bootstrap/css/bootstrap.min.css" for ::1 at 2020-11-22 17:21:15 +0800
ActionController::RoutingError (No route matches [GET] "/shop-homepage.css"):
ActionController::RoutingError (No route matches [GET] "/bootstrap/css/bootstrap.min.css"):
Started GET "/css/shop-homepage.css" for ::1 at 2020-11-22 17:21:15 +0800
我的资产是这样的
我已经编辑了application.scss。我的资产在 Rails 的路径中。
@import "bootstrap-sprockets";
@import "bootstrap";
@import "../css/shop-homepage.css";
为什么它只是找不到 .css
解决方案
推荐阅读
- javascript - Angular 6 延迟加载问题
- angular - 使用 Promise 填充 MatTables(异步行)
- c++ - 如何模仿派生到基指针自动转换?
- dependency-injection - 从 DryIoc 中的注册中排除类型
- django - /处的完整性错误
- discord.js - 检查消息是否有频道提及
- c# - 如何获取匹配正则表达式(c#)的字符串的一部分?
- listview - 从 ListView 获取对象时强制转换无效
- python - pyuic5 - ModuleNotFoundError:没有名为 PyQt5.sip 的模块
- javascript - 从 Vue 外部获取 Vue 组件的数据