show.html.erb
<%= render :partial => "hello", :collection => hello %>
_hello.html.erb
<%= div_for hello do %>
<%= link_to image_tag( hello.image, :size => "75x75"), '#' %>
<%= hello.updated_at.strftime('%m/%d/%Y') %>
<% end %>
現在出力:
hello1
hello2
等
必要な出力:
hello1 hello2 hello3 hello4
hello5 hello6 hello7 hello8
等
基本的に、アイテムを1行に1つずつではなく、列に並べてレンダリングしたいと思います。私はテーブルを使ってみましたが、divをフロートする方法を知っていますが、私が抱えている問題は、railsがdivクラスとidを生成することであり、cssファイルで作成する以外にこれを行う方法がわかりません。 id1、id2、id3、id4、...id200などのルール。特定の数のアイテムを1行に配置する簡単な方法ではないかと思いました。