From f0fabc5e10a2e5619f14bef14351d9d34a1fa76d Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Mon, 1 Aug 2016 15:45:10 -0400 Subject: [PATCH] Update customers_controller.rb --- app/controllers/customers_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/customers_controller.rb b/app/controllers/customers_controller.rb index a6a7e2a..bad8cf7 100644 --- a/app/controllers/customers_controller.rb +++ b/app/controllers/customers_controller.rb @@ -21,12 +21,10 @@ class CustomersController < ApplicationController # display a list of all customers def index if params[:search] - @customers = Customer.search(params[:search]).paginate(:page => params[:page]) + @customers = Customer.search(params[:search]).paginate(:page => params[:page]).sort if only_one_non_zero?(@customers) redirect_to @customers.first end - #else - # @customers = Customer.paginate(:page => params[:page]) end end