aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorMichel Etienne2014-07-11 16:35:14 +0200
committerMichel Etienne2014-07-11 16:35:14 +0200
commit101b9c237485ea6ec26bb583735c5d26f0d2efb2 (patch)
tree7852dbce1e6def3db0aab910ad790ba716db759b /app/controllers
parenta7939d2991770328163723951edca6cf23148570 (diff)
downloadchouette-core-101b9c237485ea6ec26bb583735c5d26f0d2efb2.tar.bz2
duplicate timetable, Mantis 25466
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/time_tables_controller.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/time_tables_controller.rb b/app/controllers/time_tables_controller.rb
index b2fdf711b..20100ddd6 100644
--- a/app/controllers/time_tables_controller.rb
+++ b/app/controllers/time_tables_controller.rb
@@ -31,6 +31,14 @@ class TimeTablesController < ChouetteController
end
end
+ def duplicate
+ @time_table = Chouette::TimeTable.find params[:id]
+ @time_table = @time_table.duplicate
+ @time_table.save
+ flash[:notice] = I18n.translate("time_tables.duplicate_success")
+ redirect_to edit_referential_time_table_path(@referential, @time_table)
+ end
+
protected