switching between values with .each in a rails view

61 views Asked by At

I remember seeing a rails method that was something like:

<%= toggle(["hello", "i", "am"]) %>

and if put in a .each like this:

<% @something.each do |s| %>
    <%= toggle(["hello", "i", "am"]) %>
<% end %>

it should produce the following:

hello i am

I've been searching through documentation online and can't find this method but I know I've seen it somewhere. Does anyone know what the actual method is?

0

There are 0 answers