1

通过将 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

感谢您的任何建议。

4

1 回答 1

0

您是要显示分类单元还是要显示侧边栏?

如果它只是一个侧边栏,您不需要添加您的分类单元,您可以尝试

<% content_for :sidebar do %>
  <Add your sidebar content here...>
<% end %>

谢谢

于 2012-04-20T09:54:56.530 回答