Update vehicles_controller.rb

This commit is contained in:
2016-04-28 11:57:54 -04:00
parent b5d42fcd7b
commit 76ffda9cad

View File

@@ -37,7 +37,7 @@ class VehiclesController < ApplicationController
def show def show
@vehicle = Vehicle.find_by_id(params[:id]) @vehicle = Vehicle.find_by_id(params[:id])
if @vehicle if @vehicle
@customer = @vehicle.qbo_customer.name if @vehicle.qbo_customer @customer = @vehicle.customer.name if @vehicle.customer
else else
flash[:error] = "Vehicle Not Found" flash[:error] = "Vehicle Not Found"
render :index render :index
@@ -47,7 +47,7 @@ class VehiclesController < ApplicationController
# return an HTML form for editing a vehicle # return an HTML form for editing a vehicle
def edit def edit
@vehicle = Vehicle.find_by_id(params[:id]) @vehicle = Vehicle.find_by_id(params[:id])
@customer = @vehicle.qbo_customer.id if @vehicle.qbo_customer @customer = @vehicle.customer.id if @vehicle.customer
end end
# update a specific vehicle # update a specific vehicle