Irregular bootstrap column wrapping

前端 未结 4 1482
萌比男神i
萌比男神i 2020-12-23 12:39

Running Rails 4.1.4 with the latest releases of haml, haml-rails, sass, and bootstrap-sass. For a user display, my HAML is as such:

.tutors-listing
    .row
         


        
4条回答
  •  时光取名叫无心
    2020-12-23 13:15

    By the looks of it you are rendering all of the columns in a single row. You need to change it so that it starts a new row every 4 columns i.e. (in plain old erb)

      <% @users.each_slice(4).to_a.each do |chunk| %>
         
    <% chunk.each do |tutors| %>
    ...
    <% end %>
    <% end %>

    You might not need the to_a on the first loop

提交回复
热议问题