feat: Implement complete ticket purchasing flow with new TicketsController
- 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
This commit is contained in:
@@ -7,7 +7,6 @@ class CreateTicketTypes < ActiveRecord::Migration[8.0]
|
||||
t.integer :quantity
|
||||
t.datetime :sale_start_at
|
||||
t.datetime :sale_end_at
|
||||
t.boolean :requires_id
|
||||
t.integer :minimum_age
|
||||
t.references :event, null: false, foreign_key: false
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ class CreateTickets < ActiveRecord::Migration[8.0]
|
||||
create_table :tickets do |t|
|
||||
t.string :qr_code
|
||||
t.integer :price_cents
|
||||
t.string :status, default: "active"
|
||||
t.string :status, default: "draft"
|
||||
|
||||
# Add names to ticket
|
||||
t.string :first_name
|
||||
|
||||
Reference in New Issue
Block a user