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 FuelEntryImagesController < ApplicationController
def destroy
attachment = fuel_entry.images.attachments.find(params[:attachment_id])
attachment.purge
redirect_to images_vehicle_fuel_entry_path(vehicle, fuel_entry), status: :see_other, notice: "Fuel image deleted."
end
private
def vehicle
@vehicle ||= Vehicle.find(params[:vehicle_id])
end
def fuel_entry
@fuel_entry ||= vehicle.fuel_entries.find(params[:fuel_entry_id])
end
end