module ActionView::Helpers::TextHelper

def cycle(first_value, *values)

<% end %>


<% reset_cycle("colors") %>
<% end %>

<%= value %>
">
<%# Create a named cycle "colors" %>
<% item.values.each do |value| %>

">
<% @items.each do |item| %>
] %>
{ first: "June", middle: "Dae", last: "Jones" },
{ first: "Emily", middle: "Shannon", maiden: "Pike", last: "Hicks" },
{ first: "Robert", middle: "Daniel", last: "James" },
<% @items = [
<%# Cycle CSS classes for rows, and text colors for values within each row %>



<% end %>

<%= item %>
">
<% @items.each do |item| %>

<% @items = [1,2,3,4] %>
<%# Alternate CSS classes for even and odd numbers... %>

anytime using the current_cycle method.
and passing the name of the cycle. The current cycle string can be obtained
"default". You can manually reset a cycle by calling reset_cycle
named cycle. The default name for a cycle without a +:name+ key is
Passing a Hash as the last parameter with a :name key will create a
classes for table rows. You can use named cycles to allow nesting in loops.
array every time it is called. This can be used for example, to alternate
Creates a Cycle object whose +to_s+ method cycles through elements of an
def cycle(first_value, *values)
  options = values.extract_options!
  name = options.fetch(:name, "default")
  values.unshift(*first_value)
  cycle = get_cycle(name)
  unless cycle && cycle.values == values
    cycle = set_cycle(name, Cycle.new(*values))
  end
  cycle.to_s
end