From 0aef1ec53b69a57e9eb5bd2f13f0c88438e668e4 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 7 Jul 2017 11:42:26 +0200 Subject: TimeTables#index: Use new table builder helper Additionally convert the `#human_attribute_name` calls to call it on the class because this is more correct and because that method doesn't exist on the decorated collection of `@time_tables`. TODO: There's a bug here where the #show and #edit links don't link correctly, they go to `/referentials/:id` instead of `/referentials/:id/time_tables/:id`. Refs #3479 --- app/controllers/time_tables_controller.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app/controllers/time_tables_controller.rb') diff --git a/app/controllers/time_tables_controller.rb b/app/controllers/time_tables_controller.rb index 0e0cade56..f23e4c201 100644 --- a/app/controllers/time_tables_controller.rb +++ b/app/controllers/time_tables_controller.rb @@ -85,6 +85,15 @@ class TimeTablesController < ChouetteController if collection.out_of_bounds? redirect_to params.merge(:page => 1) end + + @time_tables = ModelDecorator.decorate( + @time_tables, + with: TimeTableDecorator, + context: { + referential: @referential + } + ) + build_breadcrumb :index } end -- cgit v1.2.3