Skip to content

Commit da90fe9

Browse files
Jeff Kreeftmeijerjeremy
authored andcommitted
make sure as is set before trying to build an #{as}_counter. [rails#2804 state:resolved]
Signed-off-by: Jeremy Kemper <[email protected]>
1 parent bc1c8d5 commit da90fe9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

actionpack/lib/action_view/render/partials.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def collection_with_template(template = @template)
248248

249249
@collection.each do |object|
250250
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
252252
locals[as] = object
253253

254254
segments << template.render(@view, locals)

0 commit comments

Comments
 (0)