如何为 bootstrap 卡片栏中的帖子设置样式

How to style posts in bootstrap card column

我有 post 的代码,我想以 bootstrap 卡片列格式显示。

%h4{:align => "center"} All Posts
%hr.my-3
- @posts.each do |post|
  %h4= link_to post.title, post
  %p= post.description
  %p= post.company

我想在整个页面上一致地在一张卡片中显示第一个 post,在另一张卡片中显示下一个。似乎使用 bootstrap 代码我需要手动输入个人 posts。我希望它是自动化的。谢谢

尝试

<div class="card-columns" >
@posts.each do |post|
     <div class="card" >
         <div  class="card-body" >
               access your posts here
         </div>
      </div>
 </div>