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
- 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.
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 ;)
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 »
Tickets have moved to Github
The new ticket tracker is available at https://github.com/rails/rails/issues