1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove deprecated support to passing absolute paths to render template:

This commit is contained in:
Rafael Mendonça França 2020-05-05 16:13:01 -04:00
parent d52d773946
commit 2759addf2c
No known key found for this signature in database
GPG key ID: FC23B6D0F1EEE948
4 changed files with 8 additions and 4 deletions

View file

@ -1,3 +1,7 @@
* Remove deprecated support to passing absolute paths to `render template:`.
*Rafael Mendonça França*
* Remove deprecated support to passing relative paths to `render file:`.
*Rafael Mendonça França*

View file

@ -92,8 +92,7 @@ module ActionView
when String
begin
if layout.start_with?("/")
ActiveSupport::Deprecation.warn "Rendering layouts from an absolute path is deprecated."
@lookup_context.with_fallbacks.find_template(layout, nil, false, [], details)
raise ArgumentError, "Rendering layouts from an absolute path is not supported."
else
@lookup_context.find_template(layout, nil, false, [], details)
end

View file

@ -237,10 +237,9 @@ class LayoutSetInResponseTest < ActionController::TestCase
def test_absolute_pathed_layout
@controller = AbsolutePathLayoutController.new
assert_deprecated do
assert_raises(ArgumentError) do
get :hello
end
assert_equal "layout_test.erb hello.erb", @response.body.strip
end
end

View file

@ -55,6 +55,8 @@ Please refer to the [Changelog][action-pack] for detailed changes.
### Removals
* Remove deprecated support to passing absolute paths to `render template:`.
* Remove deprecated support to passing relative paths to `render file:`.
* Remove support to template handlers that don't accept two arguments.