またはそれはありますか?どのブートストラップコンポーネントでもinspect要素を使用すると、CSSをapplication.cssから取得します(ブートストラップ自体ではありません)。私はガイドラインを何度か読んでもインストール時に間違ったことをしていました。 https://github.com/twbs/bootstrap-rubygem#a-ruby-on-railsブートストラップv4 Railsへのインストールの問題
これは私が例えばBTNクラスが作業している、何を意味するかですが、彼らはブートストラップの要素を検査するために指していない:
は、私はRailsの4.2.6を使用してから宝石を使用しています追加するのを忘れむしろapplication.cssを参照してください。また、navbar(getbootstrap.comのコピー貼り付け)はjavascriptのドロップダウンが動作する限り動作しますが、CSSはオフです。Gemfile
#Bootstrap V4 Alpha
gem 'bootstrap', '~> 4.0.0.alpha6'
* sprockets-rails (3.2.0)
application.scss
/*
* 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
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*/
@import "bootstrap";
application.js //= require jquery
後のあなたのapplication.js
ファイルの場所//= require bootstrap
で
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
//= require bootstrap
おかげで、私が試しましたそれは変わりませんでした。 – Dotol