# Find out the name of the currently :action

**URL:** <https://www.ruby-forum.com/t/find-out-the-name-of-the-currently-action/72197>\
**Category:** Rails\
**Created:** [October 15, 2006, 12:13pm UTC](https://www.ruby-forum.com/t/find-out-the-name-of-the-currently-action/72197 "2006-10-15T12:13:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Petr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ac8455/32.png) [@Petr](https://www.ruby-forum.com/u/Petr)\
**Post date:** [October 15, 2006, 12:13pm UTC](https://www.ruby-forum.com/t/find-out-the-name-of-the-currently-action/72197/1 "2006-10-15T12:13:09Z")

</div>

Hi,  
How do i find out the name of the currently ran action?  
request.parameters contains more information than i need. I just want to  
store the name of the current action in a variable.

Any ideas people?

Thanks  
Petr

---

<div class="post-metadata">

**Author:** ![Petr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ac8455/32.png) [@Petr](https://www.ruby-forum.com/u/Petr)\
**Post date:** [October 15, 2006, 12:21pm UTC](https://www.ruby-forum.com/t/find-out-the-name-of-the-currently-action/72197/2 "2006-10-15T12:21:56Z")

</div>

You could try:

@action\_name = params[:action]

Gustav  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![Petr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ac8455/32.png) [@Petr](https://www.ruby-forum.com/u/Petr)\
**Post date:** [October 15, 2006, 2:42pm UTC](https://www.ruby-forum.com/t/find-out-the-name-of-the-currently-action/72197/3 "2006-10-15T14:42:13Z")

</div>

To get the name of the controller or action:  
controller.controller\_name  
controller.action\_name

---

<div class="post-metadata">

**Author:** ![Petr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ac8455/32.png) [@Petr](https://www.ruby-forum.com/u/Petr)\
**Post date:** [October 15, 2006, 3:04pm UTC](https://www.ruby-forum.com/t/find-out-the-name-of-the-currently-action/72197/4 "2006-10-15T15:04:17Z")

</div>

On Oct 15, 2006, at 12:13, Petr wrote:

> How do i find out the name of the currently ran action?  
> request.parameters contains more information than i need. I just  
> want to  
> store the name of the current action in a variable.

params[:action] or controller.action\_name

–  
Jakob S. - [http://mentalized.net](http://mentalized.net)

---

<div class="post-metadata">

**Author:** ![Petr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ac8455/32.png) [@Petr](https://www.ruby-forum.com/u/Petr)\
**Post date:** [October 16, 2006, 4:50pm UTC](https://www.ruby-forum.com/t/find-out-the-name-of-the-currently-action/72197/5 "2006-10-16T16:50:10Z")

</div>

Are these methods considered ‘better’ than what I’ve been using:

request.symbolized\_path\_parameters[:action]

?

-Jared
