diff --git a/app/controllers/tickets_controller.rb b/app/controllers/tickets_controller.rb index a5a2234..d8be0b2 100644 --- a/app/controllers/tickets_controller.rb +++ b/app/controllers/tickets_controller.rb @@ -58,7 +58,10 @@ class TicketsController < ApplicationController redirect_to dashboard_path, alert: "Billet non trouvé" return end + @event = @ticket.event + @order = @ticket.order + rescue ActiveRecord::RecordNotFound redirect_to dashboard_path, alert: "Billet non trouvé" end diff --git a/app/views/tickets/show.html.erb b/app/views/tickets/show.html.erb index 0181f79..fb8d02c 100644 --- a/app/views/tickets/show.html.erb +++ b/app/views/tickets/show.html.erb @@ -27,7 +27,7 @@
-

Billet Électronique

+

Billet électronique

ID: #<%= @ticket.id %>

@@ -150,12 +150,12 @@
- <%= link_to dashboard_path, + <%= link_to order_path(@order), class: "px-6 py-3 border border-gray-300 text-gray-700 rounded-xl hover:bg-gray-50 text-center font-medium transition-colors duration-200" do %> - Retour au tableau de bord + Retour aux informations de commande <% end %> <% if @ticket.status == 'active' %> diff --git a/config/routes.rb b/config/routes.rb index 1a45a52..9766f0e 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -60,7 +60,6 @@ Rails.application.routes.draw do get "payments/cancel", to: "tickets#payment_cancel", as: "payment_cancel" # === Tickets === - # Support both ticket_id and qr_code for backward compatibility get "tickets/:qr_code", to: "tickets#show", as: "ticket" get "tickets/:qr_code/download", to: "tickets#download", as: "ticket_download"