Skip to content

Commit

Permalink
make sure as is set before trying to build an #{as}_counter. [#2804
Browse files Browse the repository at this point in the history
…state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information
Jeff Kreeftmeijer authored and jeremy committed May 15, 2010
1 parent bc1c8d5 commit da90fe9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/render/partials.rb
Expand Up @@ -248,7 +248,7 @@ def collection_with_template(template = @template)

@collection.each do |object|
locals[counter_name] += 1
locals["#{as.to_s}_counter".to_sym] = locals[counter_name]
locals["#{as.to_s}_counter".to_sym] = locals[counter_name] if as
locals[as] = object

segments << template.render(@view, locals)
Expand Down

0 comments on commit da90fe9

Please sign in to comment.