<% @subjects.each do |subject| %>
<h2> <%= link_to(truncate(subject.title, length:30), subject) %> </h2>
<p> <%= simple_format(subject.description) %> </p>
<% subject.posts.each do |post| %>
<%= link_to (image_tag(post.image.url, id:"subsimg")), subject_post_path
(post.subject, post) %>
<% end %>
<% end %>
post是belongs_to subject的model
我要显示这个subject的title, description,跟他底下post的图片
用.each会显示每一个post的image
要怎么写才会只显示3张图呢
又如果要显示"最新3张"跟"随机3张"要怎么写呢
谢谢