How can I get a list of controllers from within rails? I cant see any documentation on this anywhere. Thanks, Matt --~--~---------~--~----~------------~-------~--~----~ 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 groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I''m not quite sure what you are asking for here, but wouldn''t looking in apps/controller tell show you all the controllers? Chris On 6/11/07, Matt <matt-5JC3FsxXPsVpLGFMi4vTTA@public.gmane.org> wrote:> > > How can I get a list of controllers from within rails? > I cant see any documentation on this anywhere. > > Thanks, > > Matt > > > > >-- fuzzylizard.com You know you''ve achieved perfection in design, Not when you have nothing more to add, But when you have nothing more to take away. -- Antoine de Saint-Exupery --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Jun 11, 10:06 pm, "Chris Johnston" <fuzzyliz...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m not quite sure what you are asking for here, but wouldn''t looking in > apps/controller tell show you all the controllers?Im trying to programatically display the list of controllers in my app (models would also be nice), preferably without a filesystem lookup of the app directory. --~--~---------~--~----~------------~-------~--~----~ 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 groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Jun 11, 2007, at 11:50 PM, Matt wrote:> > On Jun 11, 10:06 pm, "Chris Johnston" <fuzzyliz...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> I''m not quite sure what you are asking for here, but wouldn''t >> looking in >> apps/controller tell show you all the controllers? > > Im trying to programatically display the list of controllers in my app > (models would also be nice), preferably without a filesystem lookup of > the app directory.The method ActionController::Routing.possible_controllers performs a file system lookup and will give you a starting point. If you don''t want that approach for whatever reason albeit it is already written, you could try something like ApplicationController.subclasses You''d need to be sure all controller classes have been loaded in that case. Controllers are loaded on-demand, so in production mode you''ll need a request for each one (modulus details, hierarchies, etc.). In development mode that approach won''t work in general because of const removing (the trick to get autoloading per request), in the general case in development mode only one controller class is known at any given request. -- fxn --~--~---------~--~----~------------~-------~--~----~ 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 groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> The method > > ActionController::Routing.possible_controllers > > performs a file system lookup and will give you a starting point. > > If you don''t want that approach for whatever reason albeit it is > already written, you could try something like > > ApplicationController.subclasses > > You''d need to be sure all controller classes have been loaded in that > case. Controllers are loaded on-demand, so in production mode you''ll > need a request for each one (modulus details, hierarchies, etc.). In > development mode that approach won''t work in general because of const > removing (the trick to get autoloading per request), in the general > case in development mode only one controller class is known at any > given request. > > -- fxnYou are a diamond - just what I was looking for Thanks, Matt --~--~---------~--~----~------------~-------~--~----~ 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 groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---