通过将 def seo_url 复制到结帐助手来解决。
您好,我正在尝试在结帐过程中连接侧边栏。
但我明白了:
显示 c:/Projects/musthave/spree_theme_musthave/app/views/shared/_taxonomies.html.erb 其中第 6 行提出:
#<#:0x799d910> 的未定义方法 `seo_url' 提取的源代码(第 6 行附近):
3: <ul class="navigation-list">
4: <li<%= ' class="current"' if @taxon && @taxon == taxonomy.root %>> <div class="sidebar_taxon"><%=taxonomy.name.singularize %></div></li>
5: <% taxonomy.root.children.each do |taxon| %>
6: <li<%= ' class="current"' if @taxon and ([@taxon] + @taxon.ancestors).include?(taxon) %>><%= link_to taxon.name, seo_url(taxon) %></li>
7:
8: <% end %>
9: </ul>
`seo_url' 仅在 'products_helper.rb' 中提及:
def seo_url(taxon, product = nil)
return '/t/' + taxon.permalink if product.nil?
warn "DEPRECATION: the /t/taxon-permalink/p/product-permalink urls are "+
"not used anymore. Use product_url instead. (called from #{caller[0]})"
return product_url(product)
end
无法弄清楚如何使它工作。到处搜索,但找不到任何有用的东西。
试过这个,但它没有帮助:
def get_taxonomies
@taxonomies ||= Taxonomy.find(:all, :include => {:root => :children})
@taxonomies.select { |t| !t.root.nil? }
end
感谢您的任何建议。