working on image feature

This commit is contained in:
2026-10-01 09:56:32 -06:00
parent 7d4e446d4a
commit 23d8154f17
26 changed files with 1259 additions and 57 deletions
@@ -0,0 +1,18 @@
class MaintenanceEntryImagesController < ApplicationController
def destroy
attachment = maintenance_entry.images.attachments.find(params[:attachment_id])
attachment.purge
redirect_to images_vehicle_maintenance_entry_path(vehicle, maintenance_entry), status: :see_other, notice: "Maintenance image deleted."
end
private
def vehicle
@vehicle ||= Vehicle.find(params[:vehicle_id])
end
def maintenance_entry
@maintenance_entry ||= vehicle.maintenance_entries.find(params[:maintenance_entry_id])
end
end