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>
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...