diff options
author | Jon Moss <me@jonathanmoss.me> | 2016-01-25 15:21:11 -0500 |
---|---|---|
committer | Jon Moss <me@jonathanmoss.me> | 2016-01-26 20:16:40 -0500 |
commit | 534b12afb5cd0240128c3552394004f15b18520c (patch) | |
tree | dfcc6175af1b0d103fefce8b8a98f785cb9bb1ab /actionpack | |
parent | 6dfab475ca230dfcad7a603483431c8e7a8f908e (diff) | |
download | rails-534b12afb5cd0240128c3552394004f15b18520c.tar.gz rails-534b12afb5cd0240128c3552394004f15b18520c.tar.bz2 rails-534b12afb5cd0240128c3552394004f15b18520c.zip |
Fix undefined error for `ActionController::Parameters`
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/abstract_controller/rendering.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb index 63fd76d9b7..841a4c07ad 100644 --- a/actionpack/lib/abstract_controller/rendering.rb +++ b/actionpack/lib/abstract_controller/rendering.rb @@ -82,13 +82,10 @@ module AbstractController # <tt>render :file => "foo/bar"</tt>. # :api: plugin def _normalize_args(action=nil, options={}) - case action - when ActionController::Parameters - unless action.permitted? - raise ArgumentError, "render parameters are not permitted" - end + if action.respond_to?(:permitted?) && action.permitted? + raise ArgumentError, "render parameters are not permitted" action - when Hash + elsif action.is_a?(Hash) action else options |