Skip to content
This repository
Browse code

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...
commit da90fe94662b338a2430e99ff0d3298059a28a51 1 parent bc1c8d5
Jeff Kreeftmeijer authored jeremy committed
2  actionpack/lib/action_view/render/partials.rb
@@ -248,7 +248,7 @@ def collection_with_template(template = @template)
248 248
 
249 249
         @collection.each do |object|
250 250
           locals[counter_name] += 1
251  
-          locals["#{as.to_s}_counter".to_sym] = locals[counter_name]
  251
+          locals["#{as.to_s}_counter".to_sym] = locals[counter_name] if as
252 252
           locals[as] = object
253 253
 
254 254
           segments << template.render(@view, locals)

0 notes on commit da90fe9

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