Right now here's what I have
Code Ruby:<% @month_event_dates.each do |d| -%> <% if counter == d -%> <%= link_to counter, { :controller => 'calendar', :action => 'list_date' } -%> <% else -%> <%= counter -%> <% end -%> <% end -%>
So as the counter counts up, it looks to see if each array value is equal to the current value of counter. Right now there are three values to test against, this could go up or could go down and since it's outputting counter three times, when the number of array elements went up, that would be bad.
So is there a way to say
if x == any element in array "do this" else "do that"
Any help is appreciated! Thanks.






Bookmarks