- Create new TicketsController with actions for name collection, creation, and checkout - Add dedicated ticket views (new.html.erb, checkout.html.erb, show.html.erb) - Update ticket_selection_controller.js to handle form submission via AJAX - Add store_cart endpoint in EventsController for session-based cart management - Update routes to support new ticket flow: /tickets/new, /create, /checkout - Fix attribute name consistency across views (title→name, starts_at→start_time) - Add Stripe checkout integration with proper error handling - Remove deprecated collect_names flow in favor of streamlined approach The flow is now: Event selection → AJAX cart storage → Name collection → Checkout → Payment
76 lines
3.2 KiB
Ruby
Executable File
76 lines
3.2 KiB
Ruby
Executable File
Rails.application.routes.draw do
|
|
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
|
|
|
|
# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
|
|
# Can be used by load balancers and uptime monitors to verify that the app is live.
|
|
get "up" => "rails/health#show", as: :rails_health_check
|
|
|
|
# Render dynamic PWA files from app/views/pwa/* (remember to link manifest in application.html.erb)
|
|
# get "manifest" => "rails/pwa#manifest", as: :pwa_manifest
|
|
# get "service-worker" => "rails/pwa#service_worker", as: :pwa_service_worker
|
|
|
|
# Defines the root path route ("/")
|
|
root "pages#home"
|
|
|
|
|
|
# === Devise ===
|
|
|
|
# Routes for devise authentication Gem
|
|
# Bind devise to user
|
|
devise_for :users, path: "auth", path_names: {
|
|
sign_in: "sign_in", # Route for user login
|
|
sign_out: "sign_out", # Route for user logout
|
|
password: "reset-password", # Route for changing password
|
|
confirmation: "verification", # Route for account confirmation
|
|
unlock: "unblock", # Route for account unlock
|
|
# registration: "account", # Route for user account
|
|
sign_up: "signup" # Route for user registration
|
|
},
|
|
controllers: {
|
|
sessions: "authentications/sessions", # Custom controller for sessions
|
|
registrations: "authentications/registrations", # Custom controller for registrations
|
|
passwords: "authentications/passwords", # Custom controller for passwords
|
|
confirmation: "authentications/confirmations" # Custom controller for confirmations
|
|
}
|
|
|
|
# === Pages ===
|
|
get "dashboard", to: "pages#dashboard", as: "dashboard"
|
|
|
|
# === Events ===
|
|
get "events", to: "events#index", as: "events"
|
|
get "events/:slug.:id", to: "events#show", as: "event"
|
|
post "events/:slug.:id/store_cart", to: "events#store_cart", as: "store_cart"
|
|
|
|
# === Tickets ===
|
|
get "events/:slug.:id/tickets/new", to: "tickets#new", as: "ticket_new"
|
|
post "events/:slug.:id/tickets/create", to: "tickets#create", as: "ticket_create"
|
|
get "events/:slug.:id/tickets/checkout", to: "tickets#checkout", as: "ticket_checkout"
|
|
|
|
# Step 2: Checkout
|
|
# post "events/:slug.:id/checkout", to: "events#checkout", as: "event_checkout"
|
|
# Step 3: Collect names
|
|
# get "events/:slug.:id/names", to: "events#collect_names", as: "event_collect_names"
|
|
# Step 4: Process names
|
|
# post "events/:slug.:id/names", to: "events#process_names", as: "event_process_names"
|
|
|
|
# Payment success
|
|
get "payments/success", to: "events#payment_success", as: "payment_success"
|
|
|
|
# === Tickets ===
|
|
get "tickets/:ticket_id/download", to: "events#download_ticket", as: "download_ticket"
|
|
|
|
|
|
# API routes versioning
|
|
namespace :api do
|
|
namespace :v1 do
|
|
# RESTful routes for event management
|
|
resources :events, only: [ :index, :show, :create, :update, :destroy ]
|
|
# resources :bundles, only: [ :index, :show, :create, :update, :destroy ]
|
|
|
|
|
|
# Additional API endpoints can be added here as needed
|
|
# Example: search, filtering, user-specific endpoints
|
|
end
|
|
end
|
|
end
|