Bug in Rails 2.1.0 rendering partial "counter" starts at 1?

I just upgraded to Rails 2.1 and found that the "counter" property that exists while rendering a collection using a partial now starts at 1, instead of 0 (as before). I verified that this was working in Rails 2.0.2, but it has changed in 2.1. If you have a dependency on this, be careful.

Eric Ly wrote:

I just upgraded to Rails 2.1 and found that the "counter" property that exists while rendering a collection using a partial now starts at 1, instead of 0 (as before). I verified that this was working in Rails 2.0.2, but it has changed in 2.1. If you have a dependency on this, be careful.

That's got to be a bug, right? Have you found any release notes that discuss this?

Cayce Balara wrote:

That's got to be a bug, right? Have you found any release notes that discuss this?

No, its a feature. According to lifo in #rails-contrib this is the desired behaviour. I agree btw. even if I have to change some partials now.

Cayce Balara wrote:

Jan Schwenzien wrote:

Cayce Balara wrote:

That's got to be a bug, right? Have you found any release notes that discuss this?

No, its a feature. According to lifo in #rails-contrib this is the desired behaviour. I agree btw. even if I have to change some partials now.

It's not so much about the work that needs to be done to change things - those issues are easily found/changed. To me, it's a fundamental language thing. Maybe I'm just a purist. Ruby as a language counts from zero. IMHO Rails should in this case operate the same as the basics of the underlying language.

That being said, and me not being a contributor, I'm off to fix my code. :wink:

I guess I went off to change code too soon. Looks like this has been fixed/reverted (however you see it).

http://rails.lighthouseapp.com/projects/8994/tickets/344-partial-counters-start-from-1-in-2-1

Woot zero index!