ruby on rails - Displaying div tags conditionally -


i have view lists item, reviews may/may not have. issue there arbitrary (possibly 0) number of reviews. format each review in own div element, i'll have display 'n' div elements. how can done?

edit, sample element contents:

<div id="promo_item">    promotion:     <br>   <br>    <table>      #rows item name, price, list-date     #rows values of item name, price, list-date    </table>    #comment goes here  </div> 

this example, won't implement this, know there has table values.

<% @post.reviews.each |r| %>     <div>stuf here <%= r.user.name #etc.... %></div> <% end %> 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -