George Edwards
George Edwards

Reputation: 9229

Bootstrap not working in rails app

I have set up a new rails app, which I want to use with Bootstrap. I have added:

/* *** gemfile *** */
gem 'bootstrap-sass'
gem 'autoprefixer-rails'

My application.scss file:

/*
 *= require_tree .
 *= require_self
 */
@import "bootstrap-sprockets";
@import "bootstrap";

my application.js file:

//= require jquery
//= require bootstrap-sprockets
//= require jquery_ujs
//= require turbolinks
//= require_tree .

everything else is default, I have run bundle install, but still my http://localhost:3000/widgets file is just the default html, not the bootstrap defaults.

Why is this and how do I debug it?

Upvotes: 1

Views: 1290

Answers (2)

George Edwards
George Edwards

Reputation: 9229

Got it... was missing this:

<%= stylesheet_link_tag    'application', media: 'all' %>

from my application.html.erb file!

Upvotes: 0

Andrew Hendrie
Andrew Hendrie

Reputation: 6415

You missed this part of the documentation:

Then, remove all the *= require_self and *= require_tree . statements from the sass file. Instead, use @import to import Sass files.

Upvotes: 1

Related Questions