如何在 rails will_paginate 中添加 div class clearfix
How to add a div class clearfix in a rails will_paginate
如何将 <div class="clearfix visible-lg-block visible-md-block visible-sm-block"></div>
添加到此代码中?我遇到的问题是,每个分页用户的高度并不总是相同,当高度偏离时,下一行就会变得混乱。我需要在每一行等
之后将 <div class="clearfix visible-lg-block visible-md-block visible-sm-block"></div>
插入到代码中
<div class="row community">
<% @users.in_groups_of(3, false).each do |users| %>
<% users.each do |user| %>
<div class="col-md-4 col-sm-6 col-xs-6">
<div class="col-xs-12">
<center><p class="user-name"><%= link_to user.name, user %></p></center>
</div>
<div class="col-xs-4">
<div class="user-image">
<%= link_to image_tag(user.photo.thumb.url, class: "circular"), user %>
</div>
</div>
<div class="col-xs-8 community">
<ul class="name-head">
<li class="witty">
<%= user.profile %>
</li>
<% if current_user == user %>
<li class="update"><%= link_to "Update Your Bio", edit_user_path(current_user) %></li>
<% end %>
<li class="follow">
<% unless current_user == user %>
<%= render partial: "follow_form", locals: { user: user } %>
<% end %>
</li>
</ul>
</div>
<div class="col-xs-12">
<div class="following-list">
<div class="col-xs-4">
<a href="<%= following_user_path(user.id) %>">
<center><strong id="following" class:"stat">
<%= user.following.count %><br>
following
</strong></center>
</a>
</div>
<div class="col-xs-4">
<a href="<%= followers_user_path(user.id) %>">
<center><strong id="followers" class="stat">
<%= user.followers.count %><br>
followers
</strong></center>
</a>
</div>
<div class="col-xs-4">
<a href="<%= user_path(user.id) %>">
<center><strong id="photo-count" class="stat">
<%= user.photos.count %><br>
photos
</strong></center>
</a>
</div>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<%= will_paginate @users %>
我认为将 bootstrap clearfix 与 rails 块 functino/will_paginate 一起使用是不可能的。一些选项是:clearfix every nth child
或将固定高度 css 属性 添加到包含的 div 中,这将使它们的大小相同。
如何将 <div class="clearfix visible-lg-block visible-md-block visible-sm-block"></div>
添加到此代码中?我遇到的问题是,每个分页用户的高度并不总是相同,当高度偏离时,下一行就会变得混乱。我需要在每一行等
<div class="clearfix visible-lg-block visible-md-block visible-sm-block"></div>
插入到代码中
<div class="row community">
<% @users.in_groups_of(3, false).each do |users| %>
<% users.each do |user| %>
<div class="col-md-4 col-sm-6 col-xs-6">
<div class="col-xs-12">
<center><p class="user-name"><%= link_to user.name, user %></p></center>
</div>
<div class="col-xs-4">
<div class="user-image">
<%= link_to image_tag(user.photo.thumb.url, class: "circular"), user %>
</div>
</div>
<div class="col-xs-8 community">
<ul class="name-head">
<li class="witty">
<%= user.profile %>
</li>
<% if current_user == user %>
<li class="update"><%= link_to "Update Your Bio", edit_user_path(current_user) %></li>
<% end %>
<li class="follow">
<% unless current_user == user %>
<%= render partial: "follow_form", locals: { user: user } %>
<% end %>
</li>
</ul>
</div>
<div class="col-xs-12">
<div class="following-list">
<div class="col-xs-4">
<a href="<%= following_user_path(user.id) %>">
<center><strong id="following" class:"stat">
<%= user.following.count %><br>
following
</strong></center>
</a>
</div>
<div class="col-xs-4">
<a href="<%= followers_user_path(user.id) %>">
<center><strong id="followers" class="stat">
<%= user.followers.count %><br>
followers
</strong></center>
</a>
</div>
<div class="col-xs-4">
<a href="<%= user_path(user.id) %>">
<center><strong id="photo-count" class="stat">
<%= user.photos.count %><br>
photos
</strong></center>
</a>
</div>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<%= will_paginate @users %>
我认为将 bootstrap clearfix 与 rails 块 functino/will_paginate 一起使用是不可能的。一些选项是:clearfix every nth child 或将固定高度 css 属性 添加到包含的 div 中,这将使它们的大小相同。