Permalink
Browse files

Merge pull request #27692 from y-yagi/make_render_work_with_ac_params

make `render` work with AC::Params
  • Loading branch information...
eileencodes committed Jan 16, 2017
2 parents 39c1da1 + 761afeb commit bc33fe551251cbbcce62d78f240746357c979fb8
Showing with 5 additions and 2 deletions.
  1. +0 −1 actionpack/test/controller/render_test.rb
  2. +5 −1 actionview/lib/action_view/rendering.rb
@@ -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

0 comments on commit bc33fe5

Please sign in to comment.