Book Image

Bootstrap for Rails

By : Syed F Rahman
Book Image

Bootstrap for Rails

By: Syed F Rahman

Overview of this book

Table of Contents (18 chapters)
Bootstrap for Rails
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Installing Bootstrap in a Rails project


Bootstrap is simply a package of CSS, JavaScript, and font files. You must be confused why we used the term installing with Bootstrap here. Well, there are two different ways of using Bootstrap in Rails. The first one is to directly copy the Bootstrap files at proper places in the Rails project. The second one is the Bootstrap Sass way. It is because of the second way that we used the term installing. It also comes as a gemset that can be bundle installed in any Rails project. We will explore both the ways in detail in this section.

There's also a third way, using Bootstrap files from CDN, which is the simplest of all. We will explore this at the end.

Placing Bootstrap files in a Rails project

This is the first method of using Bootstrap in Rails. Many Rails developers get this method wrong. Placing the Bootstrap files properly is very important to activate Bootstrap. Follow these steps to place Bootstrap files:

  1. Let's create a new Rails project. This time...