Render :partial


#1

Hi,

I’m using
<%=render :partial =>“comment/post_comment”
,:collection=>@post.comments%>

to render all comments of a post, but how do I know inside the partial
html if a the entry is even or odd, i.e, I need to have the zebra
effect.

Thnaks,

jp


#2

just use the cycle() helper method

ex:

  • "> ...
  • http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M000628