views:

91

answers:

2

As in the standart cycle:

- @goods.each do |good|
  ???

...to organize this (HAML):

.columns-wrapper
  .column First good
  .column Second good
  .column Third good

.columns-wrapper
  .column Fourth good
  .column Fifth good
  .column Sixth good
+3  A: 

From your example, it doesn't look like you want multiple blocks — you want to turn one dataset into several. I think what you want is each_slice(3).

Chuck
A: 
require 'active_record'

@goods.in_groups_of 3, false do |goods|
  goods.each do |good|
    ...
  end
end 
edtsech