I'm using Bootstrap for my Rails application with bootstrap-sass v. 3.1.1, which has been working just fine with the following in my application.css.scss file:
@import "bootstrap";
and nothing else. Just today I tried adding some of of own CSS for some added styling that I don't get with Bootstrap. It's for my welcome view/controller so I just added it to welcome.css.scss
.complete-class {
text-decoration: line-through;
}
From reading this section of the Rails Guides my understanding was that you could include a CSS file like welcome.css.scss in the manifest like this:
@import "bootstrap";
/*
*= require_self
*= require_tree .
*/
This did not successfully apply my CSS; nor did welcome.css.scss appear in the head tag.
As I tried to debug this I encountered a few weird things that I feel I should also point out:
1. Error importing bootstrap
The Syntastic plugin for VIM helpfully pointed out an error:
File to import not found or unreadable: bootstrap. Load path: /home/stephen/code/blocitoff/app/assets/stylesheets
This is strange because
- a) This error wasn't showing up before, despite the fact that I didn't change the line of code it refers to (@import "bootstrap")
and
- b) bootstrap is still applied faithfully in my page layout and appears in the assets in the head tag.
2. Uninstalling bootstrap-sass
I searched for the above error and found this issue which suggested that I uninstall and reinstall bootstrap-sass. That didn't work although curiously the bootstrap styilng remained on the page even when I had uninstalled the gem.
The version of rails is 4.1.5
- Moving all the css to application.css.scss
Since it seems that bootstrap is being loaded from the application.css.scss somehow I added my css there but that didn't work either.
- Incognito mode on the browser
Finally I thought that if the bootstrap isn't going away when I uninstall bootstrap-sass then maybe they're being cached on my browser? I thought that didn't happen in development but just in case I fired up chrome in incognito mode. Still no change.
Beyond just figuring out how to solve this I'd really like to understand just what's going on here--hopefully I can get a better idea of how the rails asset pipeline works.