Hi to all, Is it possible to list out all the actions inside the controller. Thanks in Advance Saravanan -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
hi saravanan! Saravanan Krishnan [2008-04-30 15:04]:> Is it possible to list out all the actions inside the controller.YourController.public_instance_methods(false) hth jens -- Jens Wille, Dipl.-Bibl. (FH) prometheus - Das verteilte digitale Bildarchiv für Forschung & Lehre Kunsthistorisches Institut der Universität zu Köln Albertus-Magnus-Platz, D-50923 Köln Tel.: +49 (0)221 470-6668, E-Mail: jens.wille-31N1O1AsgN5n68oJJulU0Q@public.gmane.org http://www.prometheus-bildarchiv.de/ --~--~---------~--~----~------------~-------~--~----~ 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 http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi -- On Wed, 30 Apr 2008, Saravanan Krishnan wrote:> > Hi to all, > > > Is it possible to list out all the actions inside the controller.I don''t know whether there''s anything higher lever, but from inside an action try this: self.class.instance_methods(false) It won''t, of course, mention cases where you''ve got a template but no action definition... but it''s not such a bad idea to put empty actions in your controller for those cases anyway. (At least, I like to.) David -- Rails training from David A. Black and Ruby Power and Light: INTRO TO RAILS June 9-12 Berlin ADVANCING WITH RAILS June 16-19 Berlin INTRO TO RAILS June 24-27 London (Skills Matter) See http://www.rubypal.com for details and updates! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
and how to get method in private, i run your scripts above, and they only show public method. Thank you Reinhart Http://teapoci.blogspot.com -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Visit Indonesia 2008 wrote:> and how to get method in private, i run your scripts above, and they > only show public method. Thank you > > > Reinhart > Http://teapoci.blogspot.comto get method in private, UploadController.private_instance_methods(false) to get method in protected, UploadController.protected_instance_methods(false) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 Wed, Apr 30, 2008 at 8:04 AM, Saravanan Krishnan <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi to all, > > > Is it possible to list out all the actions inside the controller.This is how I did it once when I needed them as options for a select: http://destiney.com/blog/rubyonrails-get-public-actions-from-a-controller -- Greg Donald http://destiney.com/ --~--~---------~--~----~------------~-------~--~----~ 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 30 Apr 2008, at 14:10, David A. Black wrote:> > Hi -- > > On Wed, 30 Apr 2008, Saravanan Krishnan wrote: > >> >> Hi to all, >> >> >> Is it possible to list out all the actions inside the controller. > > I don''t know whether there''s anything higher lever, but from inside an > action try this: > > self.class.instance_methods(false)Maybe SomeController.action_methods ? (subject of course to the same caveats you give below) Fred> > > It won''t, of course, mention cases where you''ve got a template but no > action definition... but it''s not such a bad idea to put empty actions > in your controller for those cases anyway. (At least, I like to.) > > > David > > -- > Rails training from David A. Black and Ruby Power and Light: > INTRO TO RAILS June 9-12 Berlin > ADVANCING WITH RAILS June 16-19 Berlin > INTRO TO RAILS June 24-27 London (Skills Matter) > See http://www.rubypal.com for details and updates! > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung [2008-04-30 16:35]:> Maybe SomeController.action_methods ?this includes inherited and included methods as well (namely from ApplicationController, which seems undesirable). OTOH, it respects hidden actions. so, to combine the two: SomeController.public_instance_methods(false) - SomeController.hidden_actions oh, one more thing: if you have filter_parameter_logging in your controller, filter_parameters will be added to that controller''s public instance methods. cheers jens --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi -- On Wed, 30 Apr 2008, Frederick Cheung wrote:> > > On 30 Apr 2008, at 14:10, David A. Black wrote: > >> >> Hi -- >> >> On Wed, 30 Apr 2008, Saravanan Krishnan wrote: >> >>> >>> Hi to all, >>> >>> >>> Is it possible to list out all the actions inside the controller. >> >> I don''t know whether there''s anything higher lever, but from inside an >> action try this: >> >> self.class.instance_methods(false) > > Maybe SomeController.action_methods ? (subject of course to the same > caveats you give below)I KNEW Rails must have gotten there before me :-) I''m just such a low-level kind of person.... David -- Rails training from David A. Black and Ruby Power and Light: INTRO TO RAILS June 9-12 Berlin ADVANCING WITH RAILS June 16-19 Berlin INTRO TO RAILS June 24-27 London (Skills Matter) See http://www.rubypal.com for details and updates! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---