使用awesome嵌套集的动态树菜单

时间:2010-09-26 10:40:40

标签: ruby-on-rails ruby

如何在rails中使用awesome嵌套集(或任何其他set插件)创建动态树菜单助手?结果看起来应该是这样的:

<div class="level_0">
  <span class="title">Categroy</span>
  <div class="level_1>
    <span class="title">SubCategroy</span>

    <div class="level_2>
      SubSubcategory
      SubSubcategory
      SubSubcategory
      SubSubcategory
      SubSubcategory
    </div>

    <span class="title">SubCategroy</span>

    <div class="level_2>
      SubSubcategory
      SubSubcategory
      SubSubcategory
      SubSubcategory
      SubSubcategory
    </div>

  </div>

  <div class="level_1>
    <span class="title">SubCategroy</span>

    <div class="level_2>
      SubSubcategory
      SubSubcategory
      SubSubcategory
      SubSubcategory
      SubSubcategory
    </div>

    <span class="title">SubCategroy</span>

    <div class="level_2>
      SubSubcategory
      SubSubcategory
      SubSubcategory
      SubSubcategory
      SubSubcategory
    </div>

  </div>
</div>

1 个答案:

答案 0 :(得分:0)

我设法做了类似于你在此之后描述的内容:

http://asciicasts.com/episodes/162-tree-based-navigation