aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/referential_lines_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/referential_lines_controller.rb')
-rw-r--r--app/controllers/referential_lines_controller.rb7
1 files changed, 4 insertions, 3 deletions
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