Forum: Ruby on Rails Mixing dynamic and static content in routing

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
1790b62bfcfdc8e82f325591a80b3eb9?d=identicon&s=25 Nickolay K. (nmk)
on 2006-06-13 20:10
(Received via mailing list)
Hi all,

I am working on a small project--a backend for a website with a tree
like structure. I have a Node model which acts_as_tree and use
polymorphic associations to "link" differend resources (a free form
page, a course description and so on) to the nodes.

In my routes.conf I have

map.connect '/homepage/*path_info', :controller => "index", :action
=> "show_node"

and path_to_chain(path) and chain_to_path(ary) methods in the node
class for generating a hierarchy of nodes from a path and a path from
a hierarchy of nodes respectively.

The node hierarchy is completely configurable by the user (adding and
removing nodes, turning node visibility on and off, reordering).

This covers most of what I want to achieve.

I will however also want to iclude in the hierarchy a few custom
controllers (a gallery, a small posting system, some staitstics). I
could "hardwire" routes to these controllers but this would make them
static in the hierarchy and I want them configurable.

So I am looking for a way to associate not only an ActiveRecord to a
node but also a whole "controller". Now, I know this is not possible,
so any general ideas towards a solution will be greatly appreciated.

I hope I have made myself clear enough and apologise for the long post.

Many thanks in advance,
This topic is locked and can not be replied to.