select-your-own-seat

Expand History Expand History
Collapse History Collapse History

Add a Seat Selection to Shopping Cart

Introduce the Cart model. When a visitor first makes a request to any controller, a Cart record is generated with a secure, unique token by utilizing the has_secure_token macro. Once created, that token is stored between requests in cookies[:cart_token].

The Cart model associates Seat records that the visitor has selected through the SeatSelection model.

This commit adds support for selecting a Seat and adding it to their Cart. Tests are included that ensure that the same Seat cannot be selected multiple times.

Selected Seat information is rendered in the page’s sidebar.

Desktop

select