0

多くの製品を一覧表示するページ taxons#show があります。製品をクリックすると、ユーザーはデフォルトで products#show に誘導され、そこで部分的な _cart_local.html.erb がレンダリングされます。ただし、taxons#show で製品をクリックすると、同じウィンドウにライトボックスがポップアップするように UX を変更したので、taxons コントローラー内でビューを表示します。しかし、ライトボックス内でcart _local パーシャルもレンダリングしようとすると、スタックレベルが深すぎるというエラーが発生します。

これが問題のファイルです。他の場所からも発生している可能性があることは理解しています。通常、この種のエラーの原因は何ですか?

<%= form_for :order, :url => populate_orders_path do |f| %>

<% if product.has_variants? %>
  <div id="product-variants" class="columns five alpha">
    <h6 class="product-section-title"><%= t(:variants) %></h6>
    <ul>
      <% has_checked = false
      product.variants.active(current_currency).each_with_index do |v,index|
        next if v.option_values.empty? || (!v.in_stock && !Spree::Config[:show_zero_stock_products])
        checked = !has_checked && (v.in_stock || Spree::Config[:allow_backorders])
        has_checked = true if checked %>
        <li>
          <%= radio_button_tag "products[#{product.id}]", v.id, checked, :disabled => !v.in_stock && !Spree::Config[:allow_backorders], 'data-price' => v.price_in(current_currency).display_price %>
          <label for="<%= ['products', product.id, v.id].join('_') %>">
            <span class="variant-description">
              <%= variant_options v %>
            </span>
            <% if variant_price v %>
              <span class="price diff"><%= variant_price v %></span>
            <% end %>
          </label>
        </li>
      <% end%>
    </ul>
  </div>
<% end%>

<% if product.price_in(current_currency) and !product.price.nil? %>
  <div data-hook="product_price" class="columns five <% if !product.has_variants? %> alpha <% else %> omega <% end %>">

    <div id="product-price">
      <h6 class="product-section-title"><%= t(:price) %></h6>
      <div><span class="price selling" itemprop="price"><%= product.price_in(current_currency).display_price %></span></div>
    </div>

    <div class="add-to-cart">
      <% if product.on_sale? %>      
        <%= number_field_tag (product.has_variants? ? :quantity : "variants[#{product.master.id}]"),
          1, :class => 'title', :in => 1..product.on_hand, :min => 1 %>
        <%= button_tag :class => 'large primary', :id => 'add-to-cart-button', :type => :submit do %>
          <%= t(:add_to_cart) %>
        <% end %>
      <% else %>
        <%= content_tag('strong', t(:out_of_stock)) %>
      <% end %>
    </div>
  </div>
<% else %>
    <div id="product-price">
      <br>
      <div><span class="price selling" itemprop="price"><%= t('product_not_available_in_this_currency') %></span></div>
    </div>
<% end %>    

</div>
<% end %>
4

1 に答える 1

3

このエラーは通常、再帰がうまくいかないことです。

部分呼び出し自体、または部分呼び出し内で使用される関数の 1 つ (不良/ブレーク条件なし) のいずれかです。

于 2013-03-26T15:05:18.657 に答える