This project is archived and is in readonly mode.
Partial counters start from 1 in 2.1
Reported by Frederick Cheung | June 5th, 2008 @ 08:59 PM
patch to restore starting from 0
Comments and changes to this ticket
-
Pratik June 5th, 2008 @ 09:07 PM
- State changed from new to resolved
Fixed in http://github.com/rails/rails/co...
-
Jan June 13th, 2008 @ 10:17 PM
!? according to lifo in #rails-contrib this behaviour was desired, not a bug.
-
Pratik June 13th, 2008 @ 10:39 PM
Yeah, but majority of people thought it is more sensible to change this behavior in next major release, and noticing everyone in advanced.
Thanks.
-
DavidBackeus September 6th, 2008 @ 07:48 PM
- Tag set to actionpack, patch
Just to clarify the counter has started from 1 ever since 2.0.2. You have to go back to the 1.2 branch to see it start at 0.
2.0.x: http://github.com/rails/rails/tr...
1.2.x: http://github.com/rails/rails/tr...
I had applications dependent on this behaviour (one of them using 2.0.2) so I was kind of freaked out to see them break. It's also not in the "official" change log (http://gist.github.com/8946) so I can't see how "everyone" was noticed in advance.
In the end I think it makes more sense to start at 0 though so I'll just patch my apps and be happy about it ;)
-
Frederick Cheung September 6th, 2008 @ 07:54 PM
Is that really true? both 1.2 and 2.0 eventually use each_with_index to set the value of the counter when rendering each item in the collection. add_counter_to_local_assigns is only called when rendering a single item (it is a bit weird that the default value of that counter is 1)
I believe Pratik was talking about making it start from 1 in a future version
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>