Update vehicles_controller.rb

This commit is contained in:
2016-05-06 12:20:00 -04:00
parent 039e9f97c6
commit 5d6ff72ef7

View File

@@ -34,12 +34,12 @@ class VehiclesController < ApplicationController
@vehicle = Vehicle.new(params[:vehicle])
if @vehicle.save
flash[:notice] = "New Vehicle Created"
redirect_to @vehicle
else
@customers = Customer.all.order(:name)
render :edit
end
flash[:error] = @vehicle.errors.full_messages.to_sentence if @vehicle.errors
redirect_to @vehicle
end
# display a specific vehicle