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.
Eloquently is a recruiting firm. We also host workshops that teach web development and career skills. If you are looking for a job or are interested in joining our web development workshops, please contact us!
These guides are a work in progress. If you see any errors or have a suggestion for a better way to do something, please let us know.