diff options
| author | Luc Donnet | 2012-03-01 09:33:45 +0100 |
|---|---|---|
| committer | Luc Donnet | 2012-03-01 09:33:45 +0100 |
| commit | a3c86f6713d87f9b8bb3e2164a9ae32ccd11b005 (patch) | |
| tree | 15e38365be8aa9c1a3ff64edb35445dbaa71672d /app/controllers | |
| parent | 1bf6eb00189e124674a70cb7216fb002f12b79ca (diff) | |
| download | chouette-core-a3c86f6713d87f9b8bb3e2164a9ae32ccd11b005.tar.bz2 | |
Refactor lines index view
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/lines_controller.rb | 5 |
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 |
