From 859a1d505b37c98990b0f01841d12057d68b2730 Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Tue, 12 Nov 2019 12:45:14 -0500 Subject: [PATCH] always show errors --- app/controllers/vehicles_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/vehicles_controller.rb b/app/controllers/vehicles_controller.rb index 26b7511..a4c762c 100644 --- a/app/controllers/vehicles_controller.rb +++ b/app/controllers/vehicles_controller.rb @@ -81,9 +81,10 @@ class VehiclesController < ApplicationController flash[:notice] = "Vehicle updated" redirect_to @vehicle else - flash[:error] = @vehicle.errors.full_messages.to_sentence if @vehicle.errors redirect_to edit_vehicle_path end + #show any errors anyways + flash[:error] = @vehicle.errors.full_messages.to_sentence if @vehicle.errors rescue ActiveRecord::RecordNotFound render_404 end