This project is archived and is in readonly mode.

#766 ✓resolved
Cameron Yule

Adding some more tests for the new behaviour of partial collection counters

Reported by Cameron Yule | August 6th, 2008 @ 06:25 PM

There's been changes made to partial collection counters between Rails 2.1 and Edge which haven't been fully tested.

In Rails 2.1, render :partial => 'sometemplate', with no collection parameter being passed in, still results in sometemplate_counter being set as a local variable with a value of 0.

This behaviour is no longer the same in Edge rails, where the counter is only generated for partials with a collection. This is a good change, as it allows for the counter to be over-ridden by passing in your own local variable (e.g. when you're adding new elements to a pre-rendered list via AJAX).

See this thread on the the Rails Core mailing list for more information;

http://groups.google.com/group/r...

I've attempted to write a few tests to check for this behaviour.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Referenced by

Pages