Bootstrap and Rails
Add this to your
Remove these lines from the file:
*= require_tree . *= require_self
Now add these lines:
@import "bootstrap-sprockets"; @import "bootstrap";
You should try to keep the styles for each view in a file named after that model or controller. For example, in our blog application, we will put all styles related to the post views in a file called
posts.scss. We need to import this file into the
application.scss file with a line like this:
//= require bootstrap-sprockets
Make sure that you are requiring
jquery as well. You should also have this line in your
//= require jquery
If it's not there, add it above the
require bootstrap-sprockets line.
We put together some guides for participants in our workshops. Feel free to use them. If you see any errors, please submit an issue on our github repository.