This project is archived and is in readonly mode.

#417 ✓resolved
Ken Collins

Add ActionView::Helpers::TextHelper#current_cycle to return the current cycle for better design options.

Reported by Ken Collins | June 14th, 2008 @ 07:38 PM

Access to the current value returned by cycle() helps in designing tables that have col and row spans beyond the normal 1 row zebra strip. The current_cycle() method uses the new Cycle#current_value method to return just that. The Cycle class was also re-factored a bit to keep things DRY, specifically the methods for getting the next and previous index.

Tests included cover the cases for returning the current cycle when the cycle object has a name, or not, or even more than two items. Tests included also show that calling current_cycle accidently before a cycle object was created is safe to do, just like reset_cycle.

This addition will give designers a broader range of options with cycle. Especially when needing a simple way to get the current cycle in a partial rendered further below the initial cycle() call.

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>

Attachments