Okay, I'll start by saying that I'm really new at RoR, but I haven't been able to find an answer to this anywhere.

I have a blog that outputs the 5 most recents posts on the main page and each can be expanded/collapsed. When the page is first output, only the first post's div gets a different class attribute than the remaining four, but I can't seem to find out how to print that to the template. In PHP, I would do something like:
for (i=0;i<5;i++){
if (i==0){print (<div class='show'></div>}
else{print(div class='hide'></div>}
But now, I'm trying to keep as much of that kind of functionality as I can in helpers. Is there some sort of way I can define something in a helper and just put
<div <% :class => show_hide%> >
or something similar into the template?