mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Fixed filter_vehicles_by_customer method
This commit is contained in:
@@ -34,10 +34,8 @@ class CustomersController < ApplicationController
|
|||||||
|
|
||||||
autocomplete :customer, :name, :full => false, :extra_data => [:id]
|
autocomplete :customer, :name, :full => false, :extra_data => [:id]
|
||||||
|
|
||||||
def autocomplete_customer_vehicles
|
def filter_vehicles_by_customer
|
||||||
customer = Customer.find_by_id(params[:term])
|
@filtered_vehicles = Vehicle.all.where(customer_id: params[:selected_customer])
|
||||||
items = customer.vehicles if customer
|
|
||||||
render :json => items.to_json if items
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# display a list of all customers
|
# display a list of all customers
|
||||||
@@ -144,10 +142,6 @@ class CustomersController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def filter_vehicles_by_customer
|
|
||||||
@filtered_vehicles = Customer.find(customer_id: params[:selected_customer]).vehicles
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def only_one_non_zero?( array )
|
def only_one_non_zero?( array )
|
||||||
|
|||||||
Reference in New Issue
Block a user