# How to get the name of currently executing action/controller

**URL:** <https://www.ruby-forum.com/t/how-to-get-the-name-of-currently-executing-action-controller/69257>\
**Category:** Rails\
**Created:** [September 19, 2006, 7:20pm UTC](https://www.ruby-forum.com/t/how-to-get-the-name-of-currently-executing-action-controller/69257 "2006-09-19T19:20:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ea666f/32.png) [@jeffl](https://www.ruby-forum.com/u/jeffl)\
**Post date:** [September 19, 2006, 7:20pm UTC](https://www.ruby-forum.com/t/how-to-get-the-name-of-currently-executing-action-controller/69257/1 "2006-09-19T19:20:31Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![jeffl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ea666f/32.png) [@jeffl](https://www.ruby-forum.com/u/jeffl)\
**Post date:** [September 19, 2006, 7:46pm UTC](https://www.ruby-forum.com/t/how-to-get-the-name-of-currently-executing-action-controller/69257/2 "2006-09-19T19:46:44Z")

</div>

On 9/19/06, Jeff L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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.
