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

Adding a shopping cart symbol


Before proceeding to create a shopping cart in our application, we need a handle which when clicked on, will display the shopping cart. For our application, I will add a Glyphicon font icon to display an icon in the current navigation bar of our application. So, let's proceed and make this tweak.

Navigate to app | views | layouts and edit the application.html.erb file. Just in front case of the <li> element of Home , add another <li> element with the Glyphicon icon of the shopping cart, as follows:

<li><a href="#"><span class="glyphicon glyphicon-shopping-cart"></span></a></li>

Tip

Remember, Glyphicons are font images provided by Bootstrap, by default, in its repository.

Open the browser and check for the shopping cart symbol in the navigation bar. It should look like the one shown in the following screenshot:

We will add a number beside the shopping cart icon to indicate the number of products added to the shopping...