aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/snapshots_controller.rb
diff options
context:
space:
mode:
authorZog2018-01-22 21:11:28 +0100
committerZog2018-02-09 10:21:45 +0100
commit590ff858cf0fe71b420f8a59d393319e190f68aa (patch)
treed22adbd74f7d0683c07022cb013eec8eb9df922e /app/controllers/snapshots_controller.rb
parent8b6e358e3e59c507eac738a38b54f45a133164cc (diff)
downloadchouette-core-590ff858cf0fe71b420f8a59d393319e190f68aa.tar.bz2
Refs #5669; Add a preview for snapshots for easier debugging
Diffstat (limited to 'app/controllers/snapshots_controller.rb')
-rw-r--r--app/controllers/snapshots_controller.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/controllers/snapshots_controller.rb b/app/controllers/snapshots_controller.rb
new file mode 100644
index 000000000..e453b4965
--- /dev/null
+++ b/app/controllers/snapshots_controller.rb
@@ -0,0 +1,14 @@
+class SnapshotsController < ApplicationController
+ if Rails.env.development? || Rails.env.test?
+ layout :which_layout
+ def show
+ tpl = params[:snap]
+ tpl = tpl.gsub Rails.root.to_s, ''
+ render file: tpl
+ end
+
+ def which_layout
+ "snapshots/#{params[:layout] || "default"}"
+ end
+ end
+end