From bd4fa6fbbf8d533edccddc5261eecf3f0ca9ce9d Mon Sep 17 00:00:00 2001 From: Michel Etienne Date: Fri, 6 Apr 2012 10:10:44 +0200 Subject: add timetables , update textiles --- app/controllers/time_tables_controller.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 app/controllers/time_tables_controller.rb (limited to 'app/controllers/time_tables_controller.rb') 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 -- cgit v1.2.3