If your Rails app is content-heavy, consider organizing it in a tree menu structure. Here I show how to add top-level tabs, nested links in a side bar, and breadcrumbs to go up the hierarchy.
Is there a technical reason for chosing the "Ancestry" gem rather than the "Awesome nested set" gem ? The second one seems to be more popular for few months no ?
I'm afraid that, if I start building my app with Ancestry, it could be deprecated in few weeks. :/
Could you post the CSS for the menus? Or add to show notes?
It's in the GitHub repo:
https://github.com/railscasts/162-tree-based-navigation-revised/blob/master/cms-after/app/assets/stylesheets/pages.css.scss
And if you use fragment caching, you should highlight current page in menu using javascript.
Or you can use pure CSS to highlight current page based on nested classes.
E.g, body.products > nav.item
Highlight nav.item.products when the body is also products.
I would also recommend the mongoid-ancestry gem for Mongoid based Rails apps.
I thought
simple_formatmight be new... then I found that it was added 8 years ago :PThanks for this episode.
Is there a technical reason for chosing the "Ancestry" gem rather than the "Awesome nested set" gem ? The second one seems to be more popular for few months no ?
I'm afraid that, if I start building my app with Ancestry, it could be deprecated in few weeks. :/
First sign in through GitHub to post a comment.