<% @categories.each_with_index do |category, index| %>
<div class="span-8 chanpin1bg <%= 'last' if [email protected] %>">
<div class="pad-nei">
<div class="white">
<div class="pad-nei">
<div class="chanpin1">
<div class="span-4 last"><p><span class="title-index"><%=category.name%></span></p>
<ul class="list">
<% category.children.each do |sub_category| %>
<li><%=link_to sub_category.name,sub_category %></li>
<% end %>
</ul>
</div>
<div class="r"><%=image_tag "chanpin4.jpg", :width=>"120",:height=>"132"%></div>
</div>
</div>
</div>
</div>
</div>
<%if [email protected]%>
<hr class=" space"/>
<% end %>
<% end %>
<div class="r"><%=image_tag "chanpin4.jpg", :width=>"120",:height=>"132"%></div>
这里的图片我需要迭代两张可以写成这样吗?但刚刚试了一下貌似不行,求助!
<div class="r"><%=image_tag ["chanpin4.jpg", "chanpin5.jpg" ].each { |chanpin| puts chanpin }, :width=>"120",:height=>"132"%></div>