aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2017-01-15 14:06:57 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2017-01-15 14:37:39 +0900
commit761afeb2bb1b674314fb53f691b07c9261949fc3 (patch)
tree8bee9b2fa22df3139a0769492097f82267ac070e /actionview/lib/action_view
parentaaece61a53dc943ac0e4b696c39ba61f46b7c7a3 (diff)
downloadrails-761afeb2bb1b674314fb53f691b07c9261949fc3.tar.gz
rails-761afeb2bb1b674314fb53f691b07c9261949fc3.tar.bz2
rails-761afeb2bb1b674314fb53f691b07c9261949fc3.zip
make `render` work with AC::Params
In 4.2, since AC::Params inherited `Hash`, processing in the case of `Hash` was done. But in 5.x, since AC::Params does not inherit `Hash`, need to add care for AC::Params. Related to 00285e7cf75c96553719072a27c27e4ab7d25b40
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r--actionview/lib/action_view/rendering.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/actionview/lib/action_view/rendering.rb b/actionview/lib/action_view/rendering.rb
index 0e72316eb7..cf18562c45 100644
--- a/actionview/lib/action_view/rendering.rb
+++ b/actionview/lib/action_view/rendering.rb
@@ -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