# REST Questions

**URL:** <https://www.ruby-forum.com/t/rest-questions/112187>\
**Category:** Rails\
**Created:** [August 16, 2007, 6:02am UTC](https://www.ruby-forum.com/t/rest-questions/112187 "2007-08-16T06:02:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![derek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b38774/32.png) [@derek](https://www.ruby-forum.com/u/derek)\
**Post date:** [August 16, 2007, 6:02am UTC](https://www.ruby-forum.com/t/rest-questions/112187/1 "2007-08-16T06:02:59Z")

</div>

Hey, everybody.

I feel like I’m spinning my wheels trying to understand particular  
elements of REST.  
I’ve read many blogs and tutorials, watched the PeepCode REST  
screencast, and I’ve learned a lot, but it seems like the more  
advanced topics are kind of glossed over.

For instance, resources nested in multiple associations (or  
singularly) was demonstrated, but no code was built to prove the  
concept. I just saw how you got the fancy routes.

Here’s what I mean. In routes.rb, you’ve got:

# …

map.resources :programs do |programs|  
programs.resources :tags, :name\_prefix =\> “programs\_”  
end

map.resources :episodes do |episodes|  
episodes.resources :tags, :name\_prefix =\> "episodes\_  
end

map.resources :tags

# …

Glancing at this, I can’t imagine how I could begin elegantly crafting  
TagsController.

Am I looking at this all wrong? Thanks in advance.

Derek

---

<div class="post-metadata">

**Author:** ![derek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b38774/32.png) [@derek](https://www.ruby-forum.com/u/derek)\
**Post date:** [August 16, 2007, 10:33am UTC](https://www.ruby-forum.com/t/rest-questions/112187/2 "2007-08-16T10:33:32Z")

</div>

Hi

One approach which I have found works quite well is to use protocool’s  
ResourceFu ( [http://svn.protocool.com/public/plugins/resource\_fu/](http://svn.protocool.com/public/plugins/resource_fu/) ),  
which lets you have one common ‘tags’ controller, and then a  
ProgramTags controller which delegates most of its functionality to  
the TagController, similarly for the EpisodeTags controller.

The documentation is a little lacking, but there is a working example  
of how to use ResourceFu in the caboo.se sample app, available at  
[http://sample.caboo.se/](http://sample.caboo.se/)

Regards,  
Jonathan
