gregbell/active_admin — pull request #612 by jbarket (2011-10-13 14:28:38+00:00)
Title: Added option for automatic nesting of belongs_to resources in menus

If settings.nested_associations is true, resources that belong_to the current
resource will be nested underneath it automatically. In other words, if
Comments belongs_to Posts, you'll see a menu item for Comments only when
viewing a specific Post, and that menu item will take you to the Comments
related to that post.

/posts/ <- No Comments link
/posts/1 <- /posts/1/comments as the link

All of these items accept the normal menu configuration options like label,
parent and display.

There may be depth related limitations, but I believe these line up with
the same depth limitations currently found in ActiveAdmin and
InheritedResource.

In addition to this, there is also now a function on the Resource class that will allow you to determine all belongs_to relationships when given a specific resource's name. This is capable of giving parents, children and a combination of these. It may be useful in the future for automatically creating a table_for belongs_to resources on show pages, in a somewhat similar fashion to RailsAdmin.