提交 bb33e888 编写于 作者: C Carlos Antonio da Silva

Remove deprecated logic to render templates starting with /

  render :template => "/foo/bar"
上级 49700485
......@@ -21,7 +21,6 @@ def _normalize_options(options)
end
def render_to_body(options)
options[:template].sub!(/^\//, '') if options.key?(:template)
super || " "
end
......
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册