# Controller.controller\_ name

**URL:** <https://www.ruby-forum.com/t/controller-controller-name/171337>\
**Category:** Rails\
**Created:** [June 30, 2009, 8:16pm UTC](https://www.ruby-forum.com/t/controller-controller-name/171337 "2009-06-30T20:16:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhishek\_shukla](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7cd45c/32.png) [@Abhishek\_shukla](https://www.ruby-forum.com/u/Abhishek_shukla)\
**Post date:** [June 30, 2009, 8:16pm UTC](https://www.ruby-forum.com/t/controller-controller-name/171337/1 "2009-06-30T20:16:48Z")

</div>

hey guys really got stuck and i guess this is the place where i can get  
a  
solution. I want to retrieve the controller name in a layout so i am  
using  
the following command controller.controller\_ name But what if i have a  
namespace and in the two different folder i have the same controller  
name  
then wat to do ?

Regards  
Abhis

---

<div class="post-metadata">

**Author:** ![Abhishek\_shukla](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7cd45c/32.png) [@Abhishek\_shukla](https://www.ruby-forum.com/u/Abhishek_shukla)\
**Post date:** [June 30, 2009, 8:53pm UTC](https://www.ruby-forum.com/t/controller-controller-name/171337/2 "2009-06-30T20:53:07Z")

</div>

On Tue, Jun 30, 2009 at 8:15 PM, Abhishek shukla[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> hey guys really got stuck and i guess this is the place where i can get a  
> solution. I want to retrieve the controller name in a layout so i am using  
> the following command controller.controller\_ name But what if i have a  
> namespace and in the two different folder i have the same controller name  
> then wat to do ?
> 
> Regards  
> Abhis

Quick answer: the controller and action names are kept in the params  
hash

Andrew T.  
[http://ramblingsonrails.com](http://ramblingsonrails.com)

[http://MyMvelope.com](http://MyMvelope.com) - The SIMPLE way to manage your savings
