Dynamic controller dispatching in rails 3

Is there any offical way you could dynamically dispatch controllers in
Rails 3?
My goal is to invoke different controllers based on path segments like

/news/sport-blog, should map to a blog controller
/news/sports/2, should map to a page controler

In the example cases above, the path should be queried from a STI page
model, and the type attribute should decide which controller to

psuedo code:
match “*path_segments”, :to =>

The idea behind this is that it fits very nice in a cms system where
informative url:s are important. I’ve looked at other cms systems
built on Rails, many uses a single catch-all controller, but that
forces you to write another dispatcher on your own.

Thanks in advance
Fredrik Martenson

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs