Update vehicles_controller.rb

This commit is contained in:
2016-08-04 00:13:47 -04:00
committed by GitHub
parent 702ab5013e
commit 14cb22d743

View File

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