Re: Different styles in loop

Marnen Laibow-Koser
Wed, 26 Jan 2011 15:10:17 -0000

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) %></
> p>
>
> <%= 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
marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org

Sent from my iPhone

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at