对于要以引导卡栏格式显示的帖子,我有此代码。
%h4{:align => "center"} All Posts
%hr.my-3
- @posts.each do |post|
%h4= link_to post.title, post
%p= post.description
%p= post.company
我想在整个页面中始终在一张卡片中显示第一条帖子,而在另一张卡片中显示另一条帖子。似乎带有引导代码,我需要手动输入各个帖子。我希望它是自动化的。谢谢
答案 0 :(得分:0)
尝试
<div class="card-columns" >
@posts.each do |post|
<div class="card" >
<div class="card-body" >
access your posts here
</div>
</div>
</div>