mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
Fix: Add early return for sharing-only updates
- When only updating sharing settings, return immediately after handling - Prevents ParameterMissing error when trip params are not present - Sharing updates don't require trip model params - Follows Rails best practice of 'redirect ... and return' pattern
This commit is contained in:
parent
cca025a23a
commit
a0674585d4
1 changed files with 6 additions and 1 deletions
|
|
@ -39,8 +39,13 @@ class TripsController < ApplicationController
|
|||
end
|
||||
|
||||
def update
|
||||
handle_sharing_update if params[:sharing]
|
||||
# Handle sharing settings update
|
||||
if params[:sharing]
|
||||
handle_sharing_update
|
||||
redirect_to @trip, notice: 'Trip was successfully updated.', status: :see_other and return
|
||||
end
|
||||
|
||||
# Handle regular trip update
|
||||
if @trip.update(trip_params)
|
||||
redirect_to @trip, notice: 'Trip was successfully updated.', status: :see_other
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue