Update vehicles_controller.rb

This commit is contained in:
2016-08-04 00:02:56 -04:00
committed by GitHub
parent aa33de00d2
commit a9561d1694

View File

@@ -18,6 +18,12 @@ class VehiclesController < ApplicationController
# display a list of all vehicles
def index
begin
@vehicles = Customers.find_by_id(params[:id]).vehicles
rescue ActiveRecord::RecordNotFound
render_404
end
if params[:search]
@vehicles = Vehicle.search(params[:search]).paginate(:page => params[:page])
if only_one_non_zero?(@vehicles)