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
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
just use the cycle() helper method
ex:
http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M000628
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs