Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter bootstrap: do I need both bootstrap-sass and twitter-bootstrap-rails gems?

I have the following entries my (Rails 3.2.13) Gemfile:

gem 'twitter-bootstrap-rails'
gem 'bootstrap-sass'

and in app/assets/javascripts/application.js:

//= require twitter/bootstrap

and at the top of app/assets/stylesheets/custom.css.scss:

@import 'bootstrap'

Is this "correct"? Do I need both 'twitter-bootstrap-rails' and 'bootstrap-sass' (or maybe 'bootstrap-sass-rails'), or are they redundant and possibly conflicting? Do the 'bootstrap-sass' gems include the javascript for the framework, or only the CSS?

like image 967
Jan Hettich Avatar asked Apr 27 '13 20:04

Jan Hettich


2 Answers

No you do not need both.

Just simply put this in your gemfile:

gem 'sass-rails'
gem 'bootstrap-sass'

This in application.css.scss:

@import 'bootstrap';
@import 'bootstrap-responsive';

This in application.js

//= require bootstrap

If you're still having problems you may need to look at the ordering of things in your manifest files..

like image 185
Abram Avatar answered Oct 16 '22 09:10

Abram


If you want to use SASS you should use boostrap-sass or bootstrap-sass-rails. Twitter-bootstrap-rails uses LESS source. If you were to include both there would probably be conflicts. All of them include javascript for bootstrap already and integrate into the asset pipeline.

I personally use LESS version as it is what bootstrap is originally written in. (might get faster releases when bootstrap updates)

It's generally good to check the gems out on github to evaluate your exact needs and which version of Rails they support.

like image 37
Bogdan Rybak Avatar answered Oct 16 '22 10:10

Bogdan Rybak