rhys.elsworth-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org
2008-Mar-10 12:02 UTC
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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 10 Mar 2008, at 12:02, rhys.elsworth-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org wrote:> > 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 ?> Thanks, > Rhys > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
rhys.elsworth-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org
2008-Mar-12 16:17 UTC
Re: Storing controllers outside of app/controllers
Ahhh, that worked. Thanks very much for that. Rhys On Mar 10, 12:15 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 10 Mar 2008, at 12:02, rhys.elswo...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org wrote: > > > > > > > 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 ? > > > Thanks, > > Rhys--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---