Update vehicles_controller.rb

This commit is contained in:
2016-08-03 21:57:50 -04:00
committed by GitHub
parent 7dcd8b24d2
commit 4d94308bcc

View File

@@ -95,6 +95,14 @@ class VehiclesController < ApplicationController
end
end
# returns a dynamic list of vehicles owned by a customer
def update_vehicles
@vehicles = Customer.find_by_id(params[:customer_id].to_i).vehicles
respond_to do |format|
format.js
end
end
private
def only_one_non_zero?( array )
@@ -107,13 +115,5 @@ 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_id].to_i).vehicles
respond_to do |format|
format.js
end
end
end