Where in my Rails app is the Bootstrap CSS? -
learning rails... use bootstrap-sass gem... actual bootstrap css files? seems there sort of magic going on include them. if want tweak property of css....
you're using bootstrap-sass gem preferred many rails developers. twitter bootstrap css files in gem (in vendor/assets/stylesheets/).
developers use gem include bootstrap files because makes things easier update when new bootstrap versions released updating gem (plus gems rails way, eh?). bootstrap-sass gem popular because sass default format stylesheets in rails. alternative twitter-bootstrap-rails gem uses native bootstrap less format stylesheets.
using gem, need modify file app/assets/javascripts/application.js:
#app/assets/javascripts/application.js //= require jquery //= require jquery_ujs //= require bootstrap //= require_tree . best practice add file named app/assets/stylesheets/bootstrap_and_overrides.css.scss:
# app/assets/stylesheets/bootstrap_and_overrides.css.scss @import "bootstrap"; body { padding-top: 60px; } @import "bootstrap-responsive"; this shows example of overriding bootstrap body style add padding accommodate bootstrap navigation bar. add application-specific css (or sass) in additional files in app/assets/stylesheets/.
i've written in-depth article:
that goes greater details , shows how set application layout, navigation links, rails flash messages, , form builders twitter bootstrap. article helpful if want know more.
Comments
Post a Comment