ERB迭代不显示div

时间:2013-07-21 19:43:07

标签: jquery ruby-on-rails

所以我创建了一个erb迭代,迭代生成相应产品图像的多个产品和位于图像顶部的div(.tagged)。问题是当只有一个连接(i_connection)没有显示div时,但是当有多个时,显示正确的div数。知道这里发生了什么吗?

<% if @new_manual.present? %>
  <% @new_manual.steps.each do |step| %>

    <% i_connection = Contact.find(step.input_contact) %>
    <span class="connection" data-pos-x="<%= i_connection.pos_x %>" data-pos-y="<%= i_connection.pos_y %>"  data-pos-width="<%= i_connection.pos_width %>" data-pos-height="<%= i_connection.pos_height %>"></span>

    <% o_connection = Contact.find(step.output_contact) %>
    <% cord = CordType.find(step.contact_item) %>

    <%= o_connection.product.full_name %>
    uses a <%= cord.name %>
    to plug into <%= i_connection.product.full_name %><br>
    <%= image_tag(o_connection.image.image.url(:medium)) %>

    <br>
    <%= image_tag(cord.image.url(:thumb)) %><br>
    <br>
    <div id='image_panel'>
      <%= image_tag(i_connection.image.image.url(:medium)) %>
      <div id='planetmap'></div>
    </div>

    <%= image_tag(cord.image.url(:thumb)) %>
  <% end %>
<% end %>

0 个答案:

没有答案