I've gone through my app and am having trouble finding where exactly the Twitter Bootstrap source goes when I include it through a gem. If I wanted to view the Bootstrap .css for example, how do I find it?
The alternative, as I understand, to including it as a gem would be do download and include the source directly, correct? Is one approach better than the other.
Finally, if I wanted to modify the Bootstrap css what is the best way to do it? If I had the source in my app I imagine I could just go in there and modify things. How about if I'm including it as a gem?
Some clarification on how this works would be greatly appreciated. Having the source sitting in my app's directory somewhere makes sense, and I could point to it relative to the .html files...but with the Gemfile I feel like things are in a little black box...
I absolutely agree it's underwhelming to have the Bootstrap files sit outside your application.
I recommend the following workflow in this case:
Clone the repo bootstrap-sass from Github or download the zipball. It's the official port of Bootstrap into Sass and it's kept updated by the same team.
Copy only the Sass partials (the ones whose filename begins with an underscore) to
app/vendor/assets/stylesheets
. Javascript and images go into their respective directories underapp/vendor/assets
. That will remind you to stay away from editing those files while at the same time keeping your app's asset directories clean. And whenever you feel like taking a closer look at them, they will be right at hand.Copy
bootstrap.scss
toapp/assets/stylesheets
and tinker with those as much as you want. Be sure to turn off all the features you're not using, because carrying that stuff around will mean having a larger CSS file than you need.Customize your Boostrap variables and classes and load them after the Bootstrap files in your manifest, just like you would with a gem. For instance, let's say you put your own variables into
_overrides.scss
. Yourapplication.css.scss
would look like this:That's it. That's what
app/vendor/assets
was made for!i am relatively new to RoR and found there are several different ways to implement bootstrap. i tried the gem thomas-mcdonald / bootstrap-sass and got that to work great. but i wanted to get more in depth knowledge of what exactly the bootstrap files were doing and what the code looked like. the above answer was very helpful. i just wanted to add that this bootstrap 3 video proved to be very useful and worked for me.