Jeff Luckey
2006-Sep-19  17:20 UTC
How to get the name of currently executing action/controller
Is there a way to get the name of the currently executing Action and its 
Controller?
I want to be able to call a method from within an action and in that 
method get the name of the calling action.
Example:
class MyController < ApplicationController
  def method1
    myFunction()
     .
     .
     .
  end
end  # MyController
Now in the myFunction code, I want to be able to see that it was called 
by method1 method of MyController.
I guess I''m essentially trying to see the call chain.  Is there a way
to
do this in Rails?
Thanks in advance...
-- 
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
-~----------~----~----~----~------~----~------~--~---
Andrew Stone
2006-Sep-19  17:34 UTC
Re: How to get the name of currently executing action/controller
On 9/19/06, Jeff Luckey <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Is there a way to get the name of the currently executing Action and its > Controller? > >params[:controller] and params[:action] is that what you''re after? -- Andrew Stone --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---