diff --git a/app/controllers/sandbox_controller.rb b/app/controllers/sandbox_controller.rb index ea5a3e96b..12b5dd91e 100644 --- a/app/controllers/sandbox_controller.rb +++ b/app/controllers/sandbox_controller.rb @@ -1,6 +1,10 @@ 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)) @@ -24,4 +28,18 @@ class SandboxController < ApplicationController 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/app/views/sandbox/test_sandbox.html.erb b/app/views/sandbox/admin_test_sandbox.html.erb similarity index 100% rename from app/views/sandbox/test_sandbox.html.erb rename to app/views/sandbox/admin_test_sandbox.html.erb