I would like to foreach loop through data and display this data usings bootstraps grid system having 3 columns per row, however i will need multiple rows for the amount of data
use Enumerable#each_slice
<% @work.each_slice(3) do |works| %> <div class="row"> <% works.each do |work| %> <div class="col-md-4">*work.name*</div> <% end %> </div> <% end %>