From a611afb475fb2380023edc2a4312ad32ec052e94 Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Wed, 11 May 2016 09:00:16 -0400 Subject: [PATCH] Update vehicles_controller.rb --- app/controllers/vehicles_controller.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/controllers/vehicles_controller.rb b/app/controllers/vehicles_controller.rb index 6903c9b..de81b24 100644 --- a/app/controllers/vehicles_controller.rb +++ b/app/controllers/vehicles_controller.rb @@ -42,10 +42,7 @@ class VehiclesController < ApplicationController # display a specific vehicle def show @vehicle = Vehicle.find_by_id(params[:id]) - if @vehicle - @customer = @vehicle.customer.name if @vehicle.customer - @issues = @vehicle.issues - else + if not @vehicle flash[:error] = "Vehicle Not Found" redirect_to :index end @@ -54,7 +51,6 @@ class VehiclesController < ApplicationController # return an HTML form for editing a vehicle def edit @vehicle = Vehicle.find_by_id(params[:id]) - @customer = @vehicle.customer.id if @vehicle.customer @customers = Customer.all.order(:name) end