diff options
| author | Zog | 2018-01-22 21:11:28 +0100 | 
|---|---|---|
| committer | Zog | 2018-02-09 10:21:45 +0100 | 
| commit | 590ff858cf0fe71b420f8a59d393319e190f68aa (patch) | |
| tree | d22adbd74f7d0683c07022cb013eec8eb9df922e /app/controllers/snapshots_controller.rb | |
| parent | 8b6e358e3e59c507eac738a38b54f45a133164cc (diff) | |
| download | chouette-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.rb | 14 | 
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 | 
