0
votes

I have the gem "twitter-bootstrap-rails". And I want to modify some sources files (js && less). Less is importing some files but I don't see where it takes the @import "fontawesome/font-awesome"; from? I don't see them in my app/assets... || vendor/assets...

2
is it the requirement of twiiter-bootstrap itself? - Малъ Скрылевъ
As I am going to change a lot of (js && less variables) is it better to implementing bootstrap without rails? - Papouche Guinslyzinho
Sorry Matt! I didn't understand your question. - Papouche Guinslyzinho
` change a lot of (js && less variables) ` what do you mean? which code you wish to change? - Малъ Скрылевъ
I would like to change dropdown.js && tooltip.js for the "less" I could change it in "bootstrap_and_overrides.css.less" - Papouche Guinslyzinho

2 Answers

1
votes

Edit the , adding to it the link to local resided .

:

 gem 'twitter-bootstrap-rails', :path => '/home/user/git/twitter-bootstrap-rails'

Clone the twitter-bootstrap-rails , and issue installation of gems for your project:

$ cd /home/user/git
$ git clone https://github.com/seyhunak/twitter-bootstrap-rails.git
$ cd /your/project/path
$ bundle install

So you can edit then the bootstrap's files.

Run you app with bundler:

$ bundle exec rails s
0
votes

If you want to use different versions of the javascript files than the ones that come bundled with the gem, the first step is to make sure the following isn't in your application.js:

//= require twitter/bootstrap

When you require 'twitter/bootstrap', it loads all of the individual javascript files for you. Instead, you can specify which ones you want the gem to load for you, and then you can manually require the ones that you have modified.

For example, if your modified source files were in app/assets/javascripts/bootstrap_overrides/, you would do:

//= require twitter/bootstrap/bootstrap-transition
//= require twitter/bootstrap/bootstrap-alert
//= require twitter/bootstrap/bootstrap-modal
//= require twitter/bootstrap/bootstrap-button
//= require twitter/bootstrap/bootstrap-collapse
//  ... do this for the remainder of the components you wish to import from the gem
//= require bootstrap_overrides/dropdown.js
//= require bootstrap_overrides/tooltip.js

This will let you use your own modified js instead of what's supplied with the gem. The source for the versions of tooltip.js and dropdown.js included in the gem are available at the gem's github repo: https://github.com/seyhunak/twitter-bootstrap-rails

Also, since these components require jQuery to work, be sure to include them after jQuery in your application.js

Hope this helps!