Update vehicles_controller.rb

This commit is contained in:
2016-05-06 12:27:01 -04:00
parent a70561b5bd
commit 8e6c5f81a1

View File

@@ -37,7 +37,7 @@ class VehiclesController < ApplicationController
redirect_to @vehicle redirect_to @vehicle
else else
flash[:error] = @vehicle.errors.full_messages.to_sentence flash[:error] = @vehicle.errors.full_messages.to_sentence
redirect_to :new redirect_to new_vehicle_path
end end
end end
@@ -68,7 +68,7 @@ class VehiclesController < ApplicationController
flash[:notice] = "Vehicle updated" flash[:notice] = "Vehicle updated"
redirect_to @vehicle redirect_to @vehicle
else else
redirect_to :edit redirect_to edit_vehicle_path
end end
flash[:error] = @vehicle.errors.full_messages.to_sentence if @vehicle.errors flash[:error] = @vehicle.errors.full_messages.to_sentence if @vehicle.errors
end end