Rails bootstrap导入

创建: 2018/03/24

完成: 2018/03/24

 

适用于Sass, Scss。 Less的自己网上搜吧

如何判断是不是Sass/Scss?项目里搜 gem 'sass-rails' ,gem里面有这个就是了

 1.gem里加入bootstrap

 Gemfile里加上

gem 'bootstrap-sass'

 然后安装

$ bundle install

 

 2.读取bootstrap

 

css

 

 位置  app/assets/stylesheets/application.css
 操作

 1. 把后缀改为scss

 2. 在里面加上下面两行

 @import "bootstrap-sprockets";
 @import "bootstrap";

 

 

js

 

 位置  app/assets/javascripts/application.js
 操作

 加入下面两行

//= require jquery
//= require bootstrap-sprockets

 

 

 

   
posted @ 2018-03-24 15:27  懒虫哥哥  阅读(149)  评论(0编辑  收藏  举报