Storing controllers outside of app/controllers

Hi All,

I’m trying to build a web application that will have an interface for
developers to write ‘modules’ to add to the application. I’m currently
following this structure:

app/controllers <= The main application controllers.
modules/controllers/ <= Controllers for each extra module.

In config/environment.rb I’ve added the following:

config.controller_paths << “modules/controllers”

The application works fine when accessing controllers in the main
application structure but gives an ‘Undefined Constant’ error when I
try and access a controller in the modules directory using a URL like:
http://localhost:3000/ModuleName/Controller/Action’. I am using the
default routing.

Am I missing something really obvious? Or is there a better way of
achieving the same thing?


On 10 Mar 2008, at 12:02, [email protected] wrote:

In config/environment.rb I’ve added the following:
achieving the same thing?

Do you also need to add those paths to the load path ?

Ahhh, that worked. Thanks very much for that.


On Mar 10, 12:15 pm, Frederick C. [email protected]