As stated earlier in this book, to create a Bootstrap modal, we need a <div>
element with the .modal
class. We will also add the .fade
class to apply the fading transition. It is the only transition animation provided by Bootstrap.
At end of the
application.html.erb
file, add the markup for the modal, as follows:<div class="modal fade"> </div>
One of the most important things to note here, is that we have two modals in this page. To uniquely identify each one of them, we should give different IDs to them. In this case, we already have an ID with us, which is
shoppingCart
. So, let's add it to our markup:<div class="modal fade" id="shoppingCart"> </div>
Next, we need to place a markup for a modal dialog and modal content:
<div class="modal fade" id="shoppingCart"> <div class="modal-dialog modal-lg"> <div class="modal-content"> </div> </div> </div>
Compared to the modal created in...