So the new Engines feature in Rails 2.3 is great, but there’s one big problem with the way it handles routes. The routes in all of your engines are loaded before your application routes. This is a big problem if your engines have a catch-all default route for a CMS-type thing.
The Thoughtbot guys have one solution which involves alias_method_chain and the ActionController internals. Fortunately, there’s a much simpler way.
ActionController::Routing::Routes.add_configuration_file(
"#{RAILS_ROOT}/vendor/plugins/cms/config/my_routes.rb")
(“cms” is the engine name, replace it with your own)Design by Simon Fletcher. Powered by Tumblr.
© Copyright 2010