提交 bc33fe55 编写于 作者: E Eileen M. Uchitelle 提交者: GitHub

Merge pull request #27692 from y-yagi/make_render_work_with_ac_params

make `render` work with AC::Params
......@@ -313,7 +313,6 @@ def test_dynamic_render
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")),
......
......@@ -124,7 +124,11 @@ def _normalize_args(action = nil, options = {})
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册