diff options
Diffstat (limited to 'actionpack/lib/action_view/renderer/partial_renderer.rb')
-rw-r--r-- | actionpack/lib/action_view/renderer/partial_renderer.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/renderer/partial_renderer.rb b/actionpack/lib/action_view/renderer/partial_renderer.rb index c7765732c7..e2b5e8e36e 100644 --- a/actionpack/lib/action_view/renderer/partial_renderer.rb +++ b/actionpack/lib/action_view/renderer/partial_renderer.rb @@ -283,7 +283,7 @@ module ActionView end if layout = @options[:layout] - layout = find_template(layout, @locals.keys + [@variable]) + layout = find_template(layout, @locals.keys + [@variable, @variable_counter]) end result = @template ? collection_with_template : collection_without_template @@ -292,6 +292,7 @@ module ActionView locals = @locals result.map! do |content| locals[@variable] = @collection[result.index(content)] + locals[@variable_counter] = result.index(content) layout.render(@view, @locals) { content } end end |