Skip to content
Browse files

make sure `as` is set before trying to build an #{as}_counter. [#2804

…state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
1 parent 22b020d commit 5d7ad7ba41c1c4298ad6467d63ee20e6c6acdbfd @jeffkreeftmeijer jeffkreeftmeijer committed with jeremy
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_view/partials.rb
View
2 actionpack/lib/action_view/partials.rb
@@ -218,7 +218,7 @@ def render_partial_collection(options = {}) #:nodoc:
ActionController::RecordIdentifier.partial_path(object, controller.class.controller_path)
template = _pick_partial_template(_partial_path)
local_assigns[template.counter_name] = index
- local_assigns["#{as.to_s}_counter".to_sym] = local_assigns[template.counter_name]
+ local_assigns["#{as.to_s}_counter".to_sym] = local_assigns[template.counter_name] if as
result = template.render_partial(self, object, local_assigns.dup, as)
index += 1
result

0 comments on commit 5d7ad7b

Please sign in to comment.
Something went wrong with that request. Please try again.