【发布时间】:2016-11-30 02:08:45
【问题描述】:
在我的 Ruby on Rails 应用程序的 head 部分,当我在浏览器中查看源代码时,我只能看到以下 CSS 和 JS 文件。
<link rel="stylesheet" media="all" href="/stylesheets/default.css" data-turbolinks-track="reload" />
<script src="/javascripts/default.js" data-turbolinks-track="reload">
我已将引导 CSS 和 JS 文件添加到 app/assets/stylesheets 和 app/assets/javascripts 并更改了 application.css 和 application.js 文件。我仍然无法在源代码中看到这些文件。
【问题讨论】:
-
可以粘贴 default.js 、 default.css 的代码和 application.html.erb 的 header 吗?
-
@DivyangHirpara
/* * This is a manifest file that'll be compiled into application.css, which will include all the files * listed below. * * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. * * You're free to add application-wide styles to this file and they'll appear at the bottom of the -
@divyangHirpara
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS * files in this directory. Styles in this file should be added after the last require_* statement. * It is generally better to create a new file per style scope. * *= require bootstrap *= require default *= require_self *= require_tree . */ -
@Vucko 我不知道它为什么使用 default.css 以及在哪里找到该文件?我没有使用 bootstrap-sass gem,因为有人说通过这种方式添加文件并在
application.css/js中要求它们更容易
标签: html css ruby-on-rails ruby twitter-bootstrap