af83/chouette-core

View on GitHub
app/controllers/snapshots_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
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