Ruby on railsでウェブサイトを作っており、bootstrapを使おうとしているのですが、何故か使用することが出来ません。
主に下記のサイトを参考にし、app\assets\stylesheetsにあるapplication.css.scss以下のような設定をしたのですが、何故か反映されません。
https://cyllabus.jp/courses/LVlXWNb8GcWTKy8x1gHS5g
css
1/* 2 * This is a manifest file that'll automatically include all the stylesheets available in this directory 3 * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at 4 * the top of the compiled file, but it's generally better to create a new file per style scope. 5 *= require_self 6 *= require_tree . 7*/ 8@import 'bootstrap';
app\views\layoutsにあるapplication.html.erbの中身はこうなっています。
他のViewのerbはCSSの読み込みを除き、きちんと反映されます。
html
1<!DOCTYPE html> 2<html> 3<head> 4 <title>Site</title> 5 <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> 6 <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> 7 <%= csrf_meta_tags %> 8</head> 9<body id="application"> 10 11 <div> 12 <%= yield %> 13 </div> 14 15 </body> 16</html>
bootstrapはきちんとGemFileにbootstrapと書き込み、bundle installでインストールしてあります。
開発環境はRuby on Rails 4.2.2、OSはWindows 10です。
何が原因なのでしょうか。よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。