Forum: Ruby on Rails nested resources and hierarchical trees

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Dd5a26b59ff1a034bb80f835fa81388c?d=identicon&s=25 Philipp Rosenkranz (phrosenkranz)
on 2007-07-30 01:29
Hi

I've started a project recently and decided to use the rest capabilities
of
rails.
I generated a few resources with scaffold_resource and did some nesting:

 map.resources :roots do |roots|
    roots.resources :children do |children|
      children.resources :subchildren do |subchildren|
        subchildren.resources :subsubchildren
      end
    end
 end

( I've changed the names of the resources in this post for the sake of
simplicity ;-) )

Now i want to have a overview page which shows ALL resources
hierarchical starting with the root resource (like act_as_tree or
act_as_nested_set ).
How can i do that?

BTW: the relationships are as follows:
root has_many children
children belongs_to root AND has_many subchildren
subchildren belongs_to children AND has_many subsubchildren
This topic is locked and can not be replied to.