From 55468b29bb5b23bfeb8ebe439ed62e5214284a3d Mon Sep 17 00:00:00 2001 From: jpl Date: Mon, 13 Feb 2017 15:32:06 +0100 Subject: Refs #2597: updatings line_referentials#show, according to new AD --- app/controllers/referential_lines_controller.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app/controllers/referential_lines_controller.rb') diff --git a/app/controllers/referential_lines_controller.rb b/app/controllers/referential_lines_controller.rb index c0d71d891..a91ad4b6b 100644 --- a/app/controllers/referential_lines_controller.rb +++ b/app/controllers/referential_lines_controller.rb @@ -24,7 +24,7 @@ class ReferentialLinesController < ChouetteController def show @map = LineMap.new(resource).with_helpers(self) - @routes = @line.routes.order(:name) + @routes = @line.routes.order(:name).paginate(page: params[:page], per_page: 10) @group_of_lines = @line.group_of_lines show! do build_breadcrumb :show @@ -79,10 +79,11 @@ class ReferentialLinesController < ChouetteController @q = referential.lines.search(params[:q]) if sort_column && sort_direction - @lines ||= @q.result(:distinct => true).order(sort_column + ' ' + sort_direction).paginate(:page => params[:page]).includes([:network, :company]) + @lines ||= @q.result(:distinct => true).order(sort_column + ' ' + sort_direction) else - @lines ||= @q.result(:distinct => true).order(:number).paginate(:page => params[:page]).includes([:network, :company]) + @lines ||= @q.result(:distinct => true).order(:number) end + @lines = @lines.paginate(page: params[:page], per_page: 10).includes([:network, :company]) end -- cgit v1.2.3