当我访问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: ' > ' %>
</div>
我哪里做错了?是否可以在路径上添加多个子菜单?