fix: Update views and controllers for event image display
Update all event-related view templates and controllers to properly handle and display event images throughout the application. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -45,6 +45,8 @@ class Promoter::EventsController < ApplicationController
|
||||
if @event.update(event_params)
|
||||
redirect_to promoter_event_path(@event), notice: "Event mis à jour avec succès!"
|
||||
else
|
||||
# If validation fails and a new image was attached, purge it
|
||||
@event.image.purge if @event.image.attached? && @event.changed.include?('image')
|
||||
render :edit, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user