Update vehicles_controller.rb

This commit is contained in:
2016-04-27 10:28:31 -04:00
parent 2b4bba7a88
commit 09f531ce39

View File

@@ -38,6 +38,14 @@ class VehiclesController < ApplicationController
@vehicle = Vehicle.find_by_id(params[:id])
if @vehicle
@customer = @vehicle.qbo_customer.name if @vehicle.qbo_customer
if @vehicle.vin?
details = @vehicles.get_details
@style = details['years'][0]['styles'][0]['name']
@drive = details['drivenWheels']
@doors = details['numOfDoors']
end
else
flash[:error] = "Vehicle Not Found"
render :index