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…

On 9/19/06, Jeff L. [email protected] 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 S.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs