铁路面包屑上有多个子菜单

时间:2014-07-21 16:43:27

标签: ruby-on-rails navigation submenu breadcrumbs

当我访问rails应用程序的每个页面时,我想实现一个痕迹路径,但我只能看到第一个子菜单。这是 navigation.rb 文件中的代码:

SimpleNavigation::Configuration.run do |navigation|
  navigation.renderer = Renderer::Breadcrumbs
  navigation.items do |primary|
    primary.item :home, 'Home', home_path do |secondary|
      secondary.item :courses, 'Courses', courses_path do |tertiary|
        tertiary.item :course, @course.try(:name), url_for(@course), highlights_on: %r(>courses)
      end
      secondary.item :information, 'Information', information_path
    end
  end
end

application.html.erb 文件中,我有:

<div class="breadcrumbs">
    <%= render_navigation renderer: :breadcrumbs, join_with: ' &gt; ' %>
</div>

我哪里做错了?是否可以在路径上添加多个子菜单?

0 个答案:

没有答案