From bb33e88833575184b3bd2d0877ea92e170672cde Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Sun, 15 Jan 2012 13:45:31 -0200 Subject: [PATCH] Remove deprecated logic to render templates starting with / render :template => "/foo/bar" --- .../action_controller/metal/compatibility.rb | 1 - .../new_base/render_template_test.rb | 22 ------------------- 2 files changed, 23 deletions(-) diff --git a/actionpack/lib/action_controller/metal/compatibility.rb b/actionpack/lib/action_controller/metal/compatibility.rb index 1c205d7c02..a9e46f9343 100644 --- a/actionpack/lib/action_controller/metal/compatibility.rb +++ b/actionpack/lib/action_controller/metal/compatibility.rb @@ -21,7 +21,6 @@ def _normalize_options(options) end def render_to_body(options) - options[:template].sub!(/^\//, '') if options.key?(:template) super || " " end diff --git a/actionpack/test/controller/new_base/render_template_test.rb b/actionpack/test/controller/new_base/render_template_test.rb index ade204c387..88f8cc0d6e 100644 --- a/actionpack/test/controller/new_base/render_template_test.rb +++ b/actionpack/test/controller/new_base/render_template_test.rb @@ -201,26 +201,4 @@ class TestWithLayout < Rack::TestCase assert_status 200 end end - - module Compatibility - class WithoutLayoutController < ActionController::Base - self.view_paths = [ActionView::FixtureResolver.new( - "test/basic.html.erb" => "Hello from basic.html.erb", - "shared.html.erb" => "Elastica" - )] - - def with_forward_slash - render :template => "/test/basic" - end - end - - class TestTemplateRenderWithForwardSlash < Rack::TestCase - test "rendering a normal template with full path starting with a leading slash" do - get "/render_template/compatibility/without_layout/with_forward_slash" - - assert_body "Hello from basic.html.erb" - assert_status 200 - end - end - end end -- GitLab