O'Reilly logo

Bootstrap for Rails by Syed Fazle Rahman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Bootstrap's modal in a Rails application

In our Demo Shopping Application, created in previous chapters, we had all the products listed in a single page. We will add an additional button, named Buy, beside the Show button in each product. When a user clicks on the Buy button, the browser will display a modal confirming his/her action to add the particular product to the cart. The modal will have an Add to cart button, which will simulate the behavior of the product that is being added to the cart and then will close the modal. We won't be creating a real shopping cart in this book. It's up to you to decide which method you would like to use to create a shopping cart.

Open the application.html.erb file present in the layouts folder by navigating ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required