Shared Nested Resources

I'm hoping that I'm unaware of a way of dealing with this kind of thing and that hopefully someone here can shed some light on it. However, if not, I guess I've got my work cut out for me. I suppose the solution would be some sort of formalized way of dealing with polymorphic resources. I'd have to devote some serious thought to that though.

In the plugin SimplyHelpful there are a number of polymorphic route methods that will soon make its way into Edge. It allows you to do polymorphic_url(@discussable) and get group_url(@discussable) if Group is the class of the @discussable.

Hey,

The problem you're describing is one of the reasons I created my
resource_fu plugin:

http://agilewebdevelopment.com/plugins/resource_fu

You can see it in use in the caboose sample app:

http://blog.caboo.se/articles/2007/4/15/sample-app-gets-a-quick-bump

The plugin takes the attitude that trying model a polymorphic
relationship ("something has a discussion") with a monomorphic
controller (a single discussions controller) is a pain - you're
better off creating different controllers for each polymorph (IMHO).

There's stuff in the resource_fu to keep things DRY and it "plays
nice" with simply helpful :slight_smile:

HTH, Trevor