Forum: Ruby on Rails Can I reset the cycle helper?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bruce B. (Guest)
on 2006-02-04 05:25
(Received via mailing list)
Hi:

I have lines in a table I wish to stripe BUT, every now and then
there is another type of line, a section header line. I'd like to be
able to start the line after a section heading always as one of the
two classes the cycle helper is cycling between. Is it possible? If
so, how?

bruce

PS. I realise I could do this with 'odd_or_even' or the %2 method
(mod function), but I do love the cycle helper - it is terse without
being unintelligible :-)
Grant Hollingworth (Guest)
on 2006-02-04 17:37
(Received via mailing list)
* Bruce B. <removed_email_address@domain.invalid> [2006-02-03 20:24]:
> I have lines in a table I wish to stripe BUT, every now and then
> there is another type of line, a section header line. I'd like to be
> able to start the line after a section heading always as one of the
> two classes the cycle helper is cycling between. Is it possible? If
> so, how?

reset_cycle
http://api.rubyonrails.com/classes/ActionView/Help...

As long you always want to start again with the first item, that should
work for you.
This topic is locked and can not be replied to.