refactor: Simplify PDF ticket download functionality
- Rename download_ticket action to download for consistency - Use QR code lookup consistently in both show and download actions - Simplify routes to use QR code pattern for both viewing and downloading - Remove complex dual-lookup logic in favor of consistent QR code access - Clean up route constraints and duplicate route definitions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -53,7 +53,7 @@ Rails.application.routes.draw do
|
||||
get "orders/payments/success", to: "orders#payment_success", as: "order_payment_success"
|
||||
get "orders/payments/cancel", to: "orders#payment_cancel", as: "order_payment_cancel"
|
||||
|
||||
# Legacy routes - redirect to order system
|
||||
# Legacy routes - redirect to order system
|
||||
get "events/:slug.:id/tickets/checkout", to: "tickets#checkout", as: "ticket_checkout"
|
||||
post "events/:slug.:id/tickets/retry", to: "tickets#retry_payment", as: "ticket_retry_payment"
|
||||
get "payments/success", to: "tickets#payment_success", as: "payment_success"
|
||||
@@ -61,9 +61,8 @@ Rails.application.routes.draw do
|
||||
|
||||
# === Tickets ===
|
||||
# Support both ticket_id and qr_code for backward compatibility
|
||||
get "tickets/:qr_code", to: "tickets#show", as: "ticket", constraints: { qr_code: /[^\/]+/ }
|
||||
get "tickets/:ticket_id", to: "tickets#show", as: "ticket_by_id"
|
||||
get "tickets/:ticket_id/download", to: "tickets#download_ticket", as: "download_ticket"
|
||||
get "tickets/:qr_code", to: "tickets#show", as: "ticket"
|
||||
get "tickets/:qr_code/download", to: "tickets#download", as: "ticket_download"
|
||||
|
||||
# === Promoter Routes ===
|
||||
namespace :promoter do
|
||||
|
||||
Reference in New Issue
Block a user