aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/abstract_controller
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2016-01-26 18:00:05 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2016-01-26 18:00:49 -0800
commit00285e7cf75c96553719072a27c27e4ab7d25b40 (patch)
tree3a5f8f27e6122c9b7f93c43fc720de34e0e3d6bc /actionpack/lib/abstract_controller
parent9777a97ffaedcec9b95cb1678e4c74b7cac514ea (diff)
downloadrails-00285e7cf75c96553719072a27c27e4ab7d25b40.tar.gz
rails-00285e7cf75c96553719072a27c27e4ab7d25b40.tar.bz2
rails-00285e7cf75c96553719072a27c27e4ab7d25b40.zip
fix permitted? conditional for `render` calls
Diffstat (limited to 'actionpack/lib/abstract_controller')
-rw-r--r--actionpack/lib/abstract_controller/rendering.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb
index 841a4c07ad..e765d73ce4 100644
--- a/actionpack/lib/abstract_controller/rendering.rb
+++ b/actionpack/lib/abstract_controller/rendering.rb
@@ -82,9 +82,12 @@ module AbstractController
# <tt>render :file => "foo/bar"</tt>.
# :api: plugin
def _normalize_args(action=nil, options={})
- if action.respond_to?(:permitted?) && action.permitted?
- raise ArgumentError, "render parameters are not permitted"
- action
+ if action.respond_to?(:permitted?)
+ if action.permitted?
+ action
+ else
+ raise ArgumentError, "render parameters are not permitted"
+ end
elsif action.is_a?(Hash)
action
else