select-your-own-seat

Expand History Expand History
Collapse History Collapse History

Unselect a Seat to remove it from visitor’s Cart

Change the cart summary’s <button> element to be rendered with a button_to helper, transforming its underlying element to <form> element with its method attribute set to DELETE.

This commit also introduces the SelectionsController#destroy action to handle requests made from the <form> generated by the button_to call.

In order to route requests to the selections#destroy method without a SeatSelection record identifier, declare the route as a singular resource route. To access this action, the page’s <form> element must declare its action attribute to the /seats/:seat_id/selections route, and ensure that its method is DELETE.

Desktop

unselect from cart