From 18fc7a6c8c1628ca03fa60ceee240860b0004bed Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Wed, 3 Aug 2016 21:02:45 -0400 Subject: [PATCH] Update vehicles_controller.rb --- app/controllers/vehicles_controller.rb | 3 +++ 1 file changed, 3 insertions(+) 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