diff options
Diffstat (limited to 'app/controllers/time_tables_controller.rb')
| -rw-r--r-- | app/controllers/time_tables_controller.rb | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/app/controllers/time_tables_controller.rb b/app/controllers/time_tables_controller.rb index b7fb2bf9b..edeb5a32f 100644 --- a/app/controllers/time_tables_controller.rb +++ b/app/controllers/time_tables_controller.rb @@ -86,16 +86,14 @@ class TimeTablesController < ChouetteController redirect_to params.merge(:page => 1) end - @time_tables = ModelDecorator.decorate( - @time_tables, - with: TimeTableDecorator, - context: { - referential: @referential - } - ) + @time_tables = decorate_time_tables(@time_tables) build_breadcrumb :index } + + format.js { + @time_tables = decorate_time_tables(@time_tables) + } end end @@ -195,6 +193,16 @@ class TimeTablesController < ChouetteController Chouette::TimeTable.find(from_id) if from_id end + def decorate_time_tables(time_tables) + ModelDecorator.decorate( + time_tables, + with: TimeTableDecorator, + context: { + referential: @referential + } + ) + end + def time_table_params params.require(:time_table).permit( :objectid, |
