Redirect to reservation after created notification

This commit is contained in:
2025-04-22 08:23:29 +02:00
parent defe45f631
commit dc51f532a4
2 changed files with 5 additions and 6 deletions

View File

@@ -47,7 +47,7 @@ class ReservationsController < ApplicationController
assign_customer_to_reservation
if @reservation.save
redirect_to @reservation, notice: t('.reservation_created')
redirect_to reservations_url, notice: t('.reservation_created')
else
@customers = @company.customers
render :new, status: :unprocessable_entity
@@ -98,7 +98,7 @@ class ReservationsController < ApplicationController
# Check if reservation update was successful
# (We might ignore customer_updated status for now, or add more complex checks)
if reservation_updated
format.html { redirect_to reservation_url(@reservation), notice: t('.reservation_updated') }
format.html { redirect_to reservations_url, notice: t('.reservation_updated') }
format.json { render :show, status: :ok, location: @reservation }
else
@customers = @company.customers # Reload for form