From fec59a7495919b0979398f03dcd30ec81cb4a720 Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Wed, 3 Aug 2016 21:20:08 -0400 Subject: [PATCH] Update vehicles_controller.rb --- app/controllers/vehicles_controller.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/controllers/vehicles_controller.rb b/app/controllers/vehicles_controller.rb index 03c94e6..d6832cb 100644 --- a/app/controllers/vehicles_controller.rb +++ b/app/controllers/vehicles_controller.rb @@ -107,5 +107,13 @@ class VehiclesController < ApplicationController end found_non_zero end + + # returns a dynamic list of vehicles owned by a customer + def update_vehicles + @vehicles = Customer.find_by_id(params[:customer].to_i).vehicles + respond_to do |format| + format.js + end + end end