# Does the template know the name of the method that called it

**URL:** <https://www.ruby-forum.com/t/does-the-template-know-the-name-of-the-method-that-called-it/55123>\
**Category:** Rails\
**Created:** [March 17, 2006, 4:22am UTC](https://www.ruby-forum.com/t/does-the-template-know-the-name-of-the-method-that-called-it/55123 "2006-03-17T04:22:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![beachguy82](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9dc877/32.png) [@beachguy82](https://www.ruby-forum.com/u/beachguy82)\
**Post date:** [March 17, 2006, 4:22am UTC](https://www.ruby-forum.com/t/does-the-template-know-the-name-of-the-method-that-called-it/55123/1 "2006-03-17T04:22:33Z")

</div>

Within a template, is it possible to get the name of the calling method?  
What other data can you query within your template?

---

<div class="post-metadata">

**Author:** ![beachguy82](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9dc877/32.png) [@beachguy82](https://www.ruby-forum.com/u/beachguy82)\
**Post date:** [March 17, 2006, 7:41am UTC](https://www.ruby-forum.com/t/does-the-template-know-the-name-of-the-method-that-called-it/55123/2 "2006-03-17T07:41:00Z")

</div>

On Friday 17 Mar 2006 03:22, charlie bowman wrote:

> Within a template, is it possible to get the name of the calling method?

Try:

controller.controller\_name  
controller.action\_name

> What other data can you query within your template?

\<%= debug controller %\>

That’ll be quite a lot then. 😉

~Dave

–

Dave S.  
Rent-A-Monkey Website Development

> **[Tree Removal Service For Home & Businesses in Salt Lake City, UT](https://www.rentamonkey.com/)**
>
> Rent A Monkey Tree Service provides the safest, highest-quality tree removal for Salt Lake City, UT homes and businesses. Request a service today!

PGP Key: [http://www.rentamonkey.com/pgpkey.asc](http://www.rentamonkey.com/pgpkey.asc)
