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:
14
db/seeds.rb
14
db/seeds.rb
@@ -9,20 +9,20 @@
|
||||
# end
|
||||
|
||||
# Create admin user for development
|
||||
admin_user = User.find_or_create_by!(email: 'admin@example.com') do |u|
|
||||
u.password = 'password'
|
||||
u.password_confirmation = 'password'
|
||||
admin_user = User.find_or_create_by!(email: "admin@example.com") do |u|
|
||||
u.password = "password"
|
||||
u.password_confirmation = "password"
|
||||
u.last_name = nil
|
||||
u.first_name = nil
|
||||
end
|
||||
|
||||
# Create regular users for development
|
||||
users = User.where.not(email: 'admin@example.com').limit(5)
|
||||
users = User.where.not(email: "admin@example.com").limit(5)
|
||||
missing_users_count = 5 - users.count
|
||||
missing_users_count.times do |i|
|
||||
User.find_or_create_by!(email: "user#{i + 1}@example.com") do |u|
|
||||
u.password = 'password'
|
||||
u.password_confirmation = 'password'
|
||||
u.password = "password"
|
||||
u.password_confirmation = "password"
|
||||
u.last_name = nil
|
||||
u.first_name = nil
|
||||
end
|
||||
@@ -97,7 +97,6 @@ events.each_with_index do |event, index|
|
||||
tt.quantity = 100
|
||||
tt.sale_start_at = 1.month.ago
|
||||
tt.sale_end_at = event.start_time - 1.hour
|
||||
tt.requires_id = false
|
||||
tt.minimum_age = 18
|
||||
end
|
||||
|
||||
@@ -108,7 +107,6 @@ events.each_with_index do |event, index|
|
||||
tt.quantity = 20
|
||||
tt.sale_start_at = 1.month.ago
|
||||
tt.sale_end_at = event.start_time - 1.hour
|
||||
tt.requires_id = true
|
||||
tt.minimum_age = 21
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user