diff --git a/app/controllers/vehicles_controller.rb b/app/controllers/vehicles_controller.rb index e6daf19..03c94e6 100644 --- a/app/controllers/vehicles_controller.rb +++ b/app/controllers/vehicles_controller.rb @@ -30,6 +30,9 @@ class VehiclesController < ApplicationController def new @vehicle = Vehicle.new @customers = Customer.all.order(:name) + if params[:customer] + @customer = Customer.find_by_id(params[:customer]) + end end # create a new vehicle