Update vehicles_controller.rb

This commit is contained in:
2016-08-04 00:09:52 -04:00
committed by GitHub
parent 3d5ef2cd8a
commit 2e89a60d63

View File

@@ -19,7 +19,7 @@ class VehiclesController < ApplicationController
# display a list of all vehicles
def index
begin
@vehicles = @customer.vehicles.paginate(:page => params[:page])
@vehicles = Customer.find_by_id(params[:customer_id]).vehicles.paginate(:page => params[:page])
rescue ActiveRecord::RecordNotFound
render_404
end