以下代码给出错误:
/home/nish/staging/app/views/product_search/_products.html.erb:31: syntax error, unexpected keyword_ensure, expecting $end
<% if products.any? %>
<%= render :partial=> 'product_listing_feature', :locals => {:scope => scope, :scope_type => scope_type} %>
<ul class="products" data-hook class="products">
<div id="ql_product"></div>
<div class="page">
<taxons.each do |taxon|>
<% taxonProducts = Array.new %>
<% products.each do |product| %>
<%@ptaxon = product.get_taxonomy%>
<%if @ptaxon == taxonomy%>
<% taxonProducts.push(product) %>
<% end %>
<% end %>
<%= render :partial=> 'product_listing', :locals=>{:collection=> taxonProducts} %>
</div>
<% end %>
</div>
</ul>
<% end %>
我发现当代码中有额外内容时会发生此错误<%end%>
。我觉得我end
在适当的地方使用了 s。无法弄清楚出了什么问题