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:

<% @products.each do |product| %>

<%= truncate(product.title, :length => 35) %>

<%= image_tag(product.image_url, :size => '80x80') %>

<%= truncate(sanitize(product.description), :length => 180) %>

<%= product.price %>
<% end %>

form partial(_form.html.erb):

<%= render 'product' %>

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:

<% @products.each do |product| %>

<%= truncate(product.title, :length => 35) %>

<%= image_tag(product.image_url, :size => '80x80') %>

<%= truncate(sanitize(product.description), :length => 180) %>

<%= product.price %>
<% end %>

form partial(_form.html.erb):

<%= render 'product' %>

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,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Sent from my iPhone