Different styles in loop

Greetings friends,

what is the best way to deal with the next issue:

i have product partial(_product.html.erb), which look likes: <code> <% @products.each do |product| %>   <div class="entry">     <h3><%= truncate(product.title, :length => 35) %></h3>   <%= image_tag(product.image_url, :size => '80x80') %>     <p><%= truncate(sanitize(product.description), :length => 180) %></

    <div class="price_line">       <span class="price"><%= product.price %></span>     </div>   </div> <% end %> </code>

form partial(_form.html.erb):

<code> <form class="product_form">   <fieldset>     <%= render 'product' %></li>   </fieldset> </form> </code>

And the form partial is rendered in the index. My point is to make border right and border bottom on each product, but to exlude border right from all products which are at the at the right side of the grid, and to remove all border bottom from the products which are at the bottom of the grid. Lets say we have product grid with 5 rows and 5 columns. Would love some help about it. Thanks in Advance

Mixed_in wrote in post #977647:

Greetings friends,

what is the best way to deal with the next issue:

i have product partial(_product.html.erb), which look likes: <code> <% @products.each do |product| %>   <div class="entry">     <h3><%= truncate(product.title, :length => 35) %></h3>   <%= image_tag(product.image_url, :size => '80x80') %>     <p><%= truncate(sanitize(product.description), :length => 180) %></ >     <div class="price_line">       <span class="price"><%= product.price %></span>     </div>   </div> <% end %> </code>

form partial(_form.html.erb):

<code> <form class="product_form">   <fieldset>     <%= render 'product' %></li>   </fieldset> </form> </code>

And the form partial is rendered in the index. My point is to make border right and border bottom on each product, but to exlude border right from all products which are at the at the right side of the grid, and to remove all border bottom from the products which are at the bottom of the grid. Lets say we have product grid with 5 rows and 5 columns. Would love some help about it.

You're making life hard for yourself. Use an HTML table (this is a suitable context for one) or CSS floats. This is really an HTML and CSS issue and has nothing to do with Rails.

Thanks in AdvanceK

Best,