0

Rails 3 を使用しています。 を使用しeach_with_indexてシーケンスを生成しています。

<% @shops.each_with_index do |shop, i| %>
  <div class="item map-marker" id="shop_<%= i+1 %>">

を使ってみdiv_forましたが、代わりに がかかりますshop.id。これを行うより良い方法はありますか?

ありがとう。

4

0 に答える 0