Search code examples
ruby-on-railsdispatcherfront-controller

Is it possible to use a "front controller" in Rails?


In Spring MVC a Dispatcher servlet is used as a "front controller" to handle all of the application requests and route them appropriately.

Is it possible to use such an approach in Rails or is it required to write a separate controller for each type of action without having a "traffic cop" (front controller) directing the flow?


Solution

  • checkout the rails cast on catchall routes, I think this is what you are after:

    http://railscasts.com/episodes/46-catch-all-route