0

I am newbie using Ruby on Rails to develop simple app. I have included twitter-bootstrap-rails gem. In my site all files are included ect.

http://localhost:3000/assets/twitter-bootstrap-static/bootstrap.css?body=1

But in assets folder I cant find twitter-bootstrap-static folder or bootstrap.css file.

I am reading about Rails Asset Pipeline. Can someone simplify it to me ?

Sysrq147
  • 1,359
  • 4
  • 27
  • 49
  • 1
    If you want to browse gems source code use bundle show gem-name. For example if you run bundle show bootstrap-sass it will print the location of gem source code in my case output is /home/deep/.rvm/gems/ruby-2.1.0/gems/bootstrap-sass-3.1.1.0 . You can also open the entire source code for a gem using bundle show bootstrap-sass | xargs subl – Monideep Mar 22 '14 at 13:08

1 Answers1

2

Whilst your assets are stored in the /assets folder, any assets appended by gems (such as bootstrap) are kept out of the local assets files (keeps it clean)

If you've included the bootstrap gem, you'd need to override the elements you wish to change in your own files, as explained here:

getting application.css to override bootstrap


Asset Pipeline

The asset pipeline is a fancy name for a collection of directories, which share stylesheet, graphic & javascript data:

The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages such as CoffeeScript, Sass and ERB

There's nothing special about these folders except Rails can compile them to make minified CSS & JS files

Community
  • 1
  • 1
Richard Peck
  • 76,116
  • 9
  • 93
  • 147
  • Thank you. Can You explain me where I can find that bootstrap.css. Is it loaded from CDN. Where do it exist in my project folder ? – Sysrq147 Mar 22 '14 at 11:58
  • It doesn't exist in your project folder (it's appended via the gem after you deploy the app). You'll have to override any elements you want in your `application.css`. If you want to edit `bootstrap.css`, you'll have to include it in your `assets` folder manually :) – Richard Peck Mar 22 '14 at 12:00