destroying purchased tickets.
This commit is contained in:
parent
b18e302224
commit
892c15b64a
1 changed files with 2 additions and 0 deletions
|
|
@ -85,7 +85,9 @@ class ConferenceRegistrationsController < ApplicationController
|
|||
end
|
||||
|
||||
def destroy
|
||||
tickets_purchased = TicketPurchase.find_by(conference_id: @registration.conference_id)
|
||||
if @registration.destroy
|
||||
ticket_purchase.destroy
|
||||
redirect_to root_path,
|
||||
notice: "You are not registered for #{@conference.title} anymore!"
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue