Install Boostrap in Ruby on Rails

Tram Ho

I. Introduction

Bootstrap is a framework that includes HTML, CSS and JavaScript templates for responsive standard website development that allow the website design process to be quick and easy. Is a free collection of open source code and tools to create a complete webiste template, with predefined interface properties such as size, color, height, width, … Designers can create new products but still save time working with this framework in the design of website interface.

II. Install Boostrap in Ruby on Rails

1. Configure Gemfile

In your project directory, find and open the file called ” Gemfile “.
Then insert the following command line text:
gem 'boostrap-sass', '3.4.1'

2. Run the cmd command

Open your cmd and run the following command:
bundle install

3. Add Boostrap

In your project directory, go to the path app/assets/stylesheets and create a new file called custom.scss .
In the directory just created, we add the following two lines of commands:

That’s it, with the simple steps as above, you have successfully installed Boostrap in your project.

III. References

To learn more about Boostrap’s classes, you can refer here:

IV. Conclude

Bootstrap is an optimized framework and will be used a lot in the future. Especially in the process of designing a professional website. Hopefully with my post, I will be able to help a little in using Boostrap in your projects

Share the news now

Source : Viblo