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/<ModuleName> <= 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?

Thanks,
Rhys

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/<ModuleName> <= 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?

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

Ahhh, that worked. Thanks very much for that.

Rhys