Integrating Bootstrap
Bootstrap is an HTML, CSS, and JS framework for developing responsive, mobile-first projects on the web. Bootstrap 4 is built with Sass. In this recipe, you will learn how to use Bootstrap when developing Ruby on Rails web applications.
Getting ready
You can read more about Bootstrap 4 in Chapter 12, Bootstrap and Sass, of this book. Note that the code in this recipe uses the alpha release of Bootstrap 4. You should not use alpha or beta releases for production. The final release of Bootstrap 4 may differ from the alpha release.
How to do it...
Integrate Bootstrap into your RoR app by performing the following steps:
- Repeat the steps of the Hello world with Ruby on Rails recipe of this chapter to create a new RoR app; also, create a controller called
welcome
with an action calledindex
. - Then, add the Bootstrap and Autoprefixer gems to your application's Gemfile as follows and run the
bundle
command afterwards:gem 'bootstrap', '~> 4.0.0.alpha3'...