<% @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張"要怎麼寫呢
謝謝