# Detecting what action I'm on?

**URL:** <https://www.ruby-forum.com/t/detecting-what-action-im-on/117935>\
**Category:** Rails\
**Created:** [October 22, 2007, 4:28pm UTC](https://www.ruby-forum.com/t/detecting-what-action-im-on/117935 "2007-10-22T16:28:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmorin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@dmorin](https://www.ruby-forum.com/u/dmorin)\
**Post date:** [October 22, 2007, 4:28pm UTC](https://www.ruby-forum.com/t/detecting-what-action-im-on/117935/1 "2007-10-22T16:28:39Z")

</div>

Surely there has to be an easy answer to this question, but it’s eluding  
me. While rendering my rhtml, I’d like it to know what action it is  
currently rendering. This is for a context sensitive partial that will  
display itself differently depending on who called it. I can pass in a  
parameter, but I’d rather not repeat myself if there’s something already  
there waiting to be called. Thanks!

---

<div class="post-metadata">

**Author:** ![dmorin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@dmorin](https://www.ruby-forum.com/u/dmorin)\
**Post date:** [October 22, 2007, 4:48pm UTC](https://www.ruby-forum.com/t/detecting-what-action-im-on/117935/2 "2007-10-22T16:48:36Z")

</div>

Hi Duanne

How about

 \<%= controller.action\_name %\>

On Oct 22, 10:28 pm, Duane M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![dmorin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@dmorin](https://www.ruby-forum.com/u/dmorin)\
**Post date:** [October 22, 2007, 4:53pm UTC](https://www.ruby-forum.com/t/detecting-what-action-im-on/117935/3 "2007-10-22T16:53:38Z")

</div>

That’ll work! Thanks CCH.

CCH wrote:

> Hi Duanne
> 
> How about
> 
> \<%= controller.action\_name %\>
> 
> On Oct 22, 10:28 pm, Duane M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
