aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/time_tables_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/time_tables_controller.rb')
-rw-r--r--app/controllers/time_tables_controller.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/app/controllers/time_tables_controller.rb b/app/controllers/time_tables_controller.rb
new file mode 100644
index 000000000..dbecde0eb
--- /dev/null
+++ b/app/controllers/time_tables_controller.rb
@@ -0,0 +1,23 @@
+class TimeTablesController < ChouetteController
+ defaults :resource_class => Chouette::TimeTable
+ respond_to :html
+ respond_to :xml
+ respond_to :json
+
+ belongs_to :referential
+
+ protected
+
+ def collection
+ @q = referential.time_tables.search(params[:q])
+ @time_tables ||= @q.result(:distinct => true).order(:comment).paginate(:page => params[:page], :per_page => 10)
+ end
+
+ def resource_url(time_table = nil)
+ referential_time_table_path(referential, time_table || resource)
+ end
+
+ def collection_url
+ referential_time_tables_path(referential)
+ end
+end