我有我添加了自举宝石Ruby on Rails的引导CSS JS工作,但没有找到
首先我将此两种宝石
gem 'bootstrap'
gem 'sprockets-rails', :require => 'sprockets/railtie'
里面装了这个包
Using bootstrap 4.0.0.alpha3
Using sprockets 3.6.0
Rails应用程序
我修改后application.scss
至
// Custom bootstrap variables must be set or import before bootstrap itself.
@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 any plugin's vendor/assets/javascripts directory 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
// compiled file.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require tether
//= require bootstrap-sprockets
//= require_tree .
//= require_self
最后我application.html.erb
是这个
<!DOCTYPE html>
<html>
<head>
<title>Squirm</title>
<%= stylesheet_link_tag "bootstrap" %>
<%= javascript_include_tag "bootstrap" %>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
<body>
<%= render 'partials/navbar' %>
<div class="container">
<%= yield %>
</div>
</body>
</html>
引导似乎我们的工作,但在谷歌浏览器控制台似乎并没有被发现
谢谢@AnthonyE我有两个错误,首先是导入顺序,其次是我为项目添加了两次bootstrap。 – agusgambina