# Scaffold\_resource und acts\_as\_tree

**URL:** <https://www.ruby-forum.com/t/scaffold-resource-und-acts-as-tree/109399>\
**Category:** Rails\
**Created:** [July 14, 2007, 8:54am UTC](https://www.ruby-forum.com/t/scaffold-resource-und-acts-as-tree/109399 "2007-07-14T08:54:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 14, 2007, 8:54am UTC](https://www.ruby-forum.com/t/scaffold-resource-und-acts-as-tree/109399/1 "2007-07-14T08:54:37Z")

</div>

Routing nested resources on Models with has\_many is very  
straightforward eg.  
Project-\>Iteration-\>WorkItem

can be mapped with:

map.resources :projects do |projects|  
projects.resources :iterations do |iterations|  
iterations.resources :workItems  
end  
end

resulting in pleasant urls like  
[http://localhost:3000/projects/1/iterations/3/workitems](http://localhost:3000/projects/1/iterations/3/workitems)

- but how can you map resources with acts\_as\_tree and an arbitrary  
nesting?!  
eg.

Treenode-\>Treenode-\>Treenode-\>…

I’m trying to achieve convenient urls roughly like:  
[http://localhost:3000/treenodes/1/children3/schildren/4/children/7](http://localhost:3000/treenodes/1/children3/schildren/4/children/7)

Has anyone ever tried to map acts\_as\_tree ressources in a RESful  
manner?!

Thx for any tips!  
stf
