如何在结账过程中连接侧边栏?
通过将 def seo_url 复制到结账助手来解决。
您好,我正在尝试在结账过程中连接侧边栏。
但我得到了这个:
显示 c:/Projects/musthave/spree_theme_musthave/app/views/shared/_taxonomies.html.erb 其中第 6 行引发:
未定义方法“seo_url” for #<#:0x799d910> 提取的源代码(大约第 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
感谢您的任何建议。
Solved with copying def seo_url to checkout helper.
Hello, Im trying to connect sidebar in checkout progress.
But I get this:
Showing c:/Projects/musthave/spree_theme_musthave/app/views/shared/_taxonomies.html.erb where line #6 raised:
undefined method `seo_url' for #<#:0x799d910>
Extracted source (around line #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' is only mentioned in '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
Cant figure out how to make it work. Searched everywhere, but couldnt find anything usefull.
Tried this one, but it didnt helped:
def get_taxonomies
@taxonomies ||= Taxonomy.find(:all, :include => {:root => :children})
@taxonomies.select { |t| !t.root.nil? }
end
Thanks for any advice.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是想显示分类单元还是想显示侧边栏?
如果它只是您想要的侧边栏,则不需要添加您的分类单元,您可以尝试
谢谢
Are you trying to display taxons or are you trying to display a sidebar?
if its just a sidebar you want you dont need to add your taxons in you can try
Thanks