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

Merge pull request #27692 from y-yagi/make_render_work_with_ac_params

make `render` work with AC::Params
This commit is contained in:
Eileen M. Uchitelle 2017-01-16 10:09:56 -05:00 committed by GitHub
commit bc33fe5512
2 changed files with 5 additions and 2 deletions

View file

@ -313,7 +313,6 @@ class ExpiresInRenderTest < ActionController::TestCase
end
def test_permitted_dynamic_render_file_hash
skip "FIXME: this test passes on 4-2-stable but not master. Why?"
assert File.exist?(File.join(File.dirname(__FILE__), "../../test/abstract_unit.rb"))
response = get :dynamic_render_permit, params: { id: { file: '../\\../test/abstract_unit.rb' } }
assert_equal File.read(File.join(File.dirname(__FILE__), "../../test/abstract_unit.rb")),

View file

@ -124,7 +124,11 @@ module ActionView
key = action.include?(?/) ? :template : :action
options[key] = action
else
options[:partial] = action
if action.respond_to?(:permitted?) && action.permitted?
options = action
else
options[:partial] = action
end
end
options