From c6c3ff542302a6ad1d8fd2abcee7ff43ad01149b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 1 Oct 2019 16:26:59 +0200 Subject: [PATCH] Remove leftover sandbox code The rest of the sandbox code was removed in commit d679c1eb. --- app/controllers/sandbox_controller.rb | 45 --------------------------- config/routes.rb | 6 ---- 2 files changed, 51 deletions(-) delete mode 100644 app/controllers/sandbox_controller.rb diff --git a/app/controllers/sandbox_controller.rb b/app/controllers/sandbox_controller.rb deleted file mode 100644 index ca18b4588..000000000 --- a/app/controllers/sandbox_controller.rb +++ /dev/null @@ -1,45 +0,0 @@ -class SandboxController < ApplicationController - skip_authorization_check - - layout :set_layout - - helper_method(:namespace) - - def index - @templates = Dir.glob(Rails.root.join("app", "views", "sandbox", "*.html.erb").to_s).map do |filename| - filename = File.basename(filename, File.extname(filename)) - filename unless filename.starts_with?("_") || filename == "index.html" - end.compact - end - - def show - if params[:template].index(".") # CVE-2014-0130 - render action: "index" - elsif lookup_context.exists?("sandbox/#{params[:template]}") - if params[:template] == "index" - render action: "index" - else - render "sandbox/#{params[:template]}" - end - - elsif lookup_context.exists?("sandbox/#{params[:template]}/index") - render "sandbox/#{params[:template]}/index" - else - render action: "index" - end - end - - private - - def set_layout - if params[:template] && params[:template].split("_").first == "admin" - "admin" - else - "application" - end - end - - def namespace - "admin" - end -end diff --git a/config/routes.rb b/config/routes.rb index 4a380a23c..1b30f8e2c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,12 +1,6 @@ Rails.application.routes.draw do mount Ckeditor::Engine => "/ckeditor" - - if Rails.env.development? || Rails.env.staging? - get "/sandbox" => "sandbox#index" - get "/sandbox/*template" => "sandbox#show" - end - mount LetterOpenerWeb::Engine, at: "/letter_opener" if Rails.env.development? draw :account