diff options
| author | Michel Etienne | 2012-04-06 10:10:44 +0200 | 
|---|---|---|
| committer | Michel Etienne | 2012-04-06 10:10:44 +0200 | 
| commit | bd4fa6fbbf8d533edccddc5261eecf3f0ca9ce9d (patch) | |
| tree | e5a0ee1ca894d97ef129387869fdbfae95e1d496 /app/controllers/time_tables_controller.rb | |
| parent | 8997a187061244ad086a3985b94a6369d68c837e (diff) | |
| download | chouette-core-bd4fa6fbbf8d533edccddc5261eecf3f0ca9ce9d.tar.bz2 | |
add timetables , update textiles
Diffstat (limited to 'app/controllers/time_tables_controller.rb')
| -rw-r--r-- | app/controllers/time_tables_controller.rb | 23 | 
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 | 
