应该如何看待 ruby 中的 application.scss 文件? [英] How should look a application.scss file in ruby?
本文介绍了应该如何看待 ruby 中的 application.scss 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是 ruby 新手,我的代码如下所示:这正确吗?我的助推器无法加载..
I'm new in ruby and my code looks like this: Is this correct? My boostrap does not load..
所以application.scss
//= require .
//= require_self
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require bootstrap
//= require_tree .
@import "bootstrap-sprockets";
@import "bootstrap";
application.js 看起来像这样:
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require bootstrap-sprockets
//= require_tree .
感谢您的解释!
推荐答案
sass 文件中我们不包含 require,你可以删除它们.用如下代码替换你的代码
In sass files we does't include require,you can remove them.replace your code with as follows
@import "bootstrap-sprockets";
@import "bootstrap";
这篇关于应该如何看待 ruby 中的 application.scss 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文