fix: Resolve tickets controller Event lookup issues

- Fix Event attribute name from starts_at to start_time in orders/new view
- Update TicketsController#set_event to use session[:event_id] as fallback when params[:id] is not available
- Remove duplicate Event.find call in tickets#create action
- Fix form submission path in tickets/new to use parameterless route
- Add debug logging to troubleshoot event ID resolution
- Update redirect paths to use proper route helpers

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
kbe
2025-09-04 01:12:59 +02:00
parent ee4399aa46
commit 0f6d75b1e8
3 changed files with 21 additions and 9 deletions

View File

@@ -14,9 +14,9 @@
<div class="mb-6">
<h3 class="text-lg font-medium text-gray-800"><%= @event.name %></h3>
<p class="text-gray-600"><%= @event.venue_name %></p>
<% if @event.starts_at %>
<% if @event.start_time %>
<p class="text-sm text-gray-500">
<%= @event.starts_at.strftime("%d/%m/%Y à %H:%M") %>
<%= @event.start_time.strftime("%d/%m/%Y à %H:%M") %>
</p>
<% end %>
</div>

View File

@@ -98,7 +98,7 @@
les billets.</p>
</div>
<%= form_with url: ticket_create_path(@event.slug, @event), method: :post, local: true, class: "space-y-8" do |form| %>
<%= form_with url: ticket_create_path, method: :post, local: true, class: "space-y-8" do |form| %>
<% if @tickets_needing_names.any? %>
<div class="space-y-6">
<div class="flex items-center justify-center mb-2">