aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorLuc Donnet2012-03-01 09:33:45 +0100
committerLuc Donnet2012-03-01 09:33:45 +0100
commita3c86f6713d87f9b8bb3e2164a9ae32ccd11b005 (patch)
tree15e38365be8aa9c1a3ff64edb35445dbaa71672d /app/controllers
parent1bf6eb00189e124674a70cb7216fb002f12b79ca (diff)
downloadchouette-core-a3c86f6713d87f9b8bb3e2164a9ae32ccd11b005.tar.bz2
Refactor lines index view
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/lines_controller.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/lines_controller.rb b/app/controllers/lines_controller.rb
index a5be8ca44..6968618b8 100644
--- a/app/controllers/lines_controller.rb
+++ b/app/controllers/lines_controller.rb
@@ -7,8 +7,9 @@ class LinesController < ChouetteController
protected
- def collection
- @lines ||= referential.lines.order_by [[sort_column.to_sym, sort_direction.to_sym]]
+ def collection
+ @q = Chouette::Line.search(params[:q])
+ @lines ||= @q.result(:distinct => true).paginate(:page => params[:page], :per_page => 10)
end
def sort_column