# Check for which page the helper is in

**URL:** <https://www.ruby-forum.com/t/check-for-which-page-the-helper-is-in/150946>\
**Category:** Rails\
**Created:** [October 15, 2008, 4:48am UTC](https://www.ruby-forum.com/t/check-for-which-page-the-helper-is-in/150946 "2008-10-15T04:48:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hyuuu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/9d8465/32.png) [@hyuuu](https://www.ruby-forum.com/u/hyuuu)\
**Post date:** [October 15, 2008, 4:48am UTC](https://www.ruby-forum.com/t/check-for-which-page-the-helper-is-in/150946/1 "2008-10-15T04:48:45Z")

</div>

I want to check which controller or action I am currently in, I can  
access controller.controller\_name but is there a more elegant way to do  
it?  
Something like, am\_I\_in {:controller=\>‘user’,:action=\>‘index’} or  
am\_I\_in ‘/user/index’

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![hyuuu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/9d8465/32.png) [@hyuuu](https://www.ruby-forum.com/u/hyuuu)\
**Post date:** [October 15, 2008, 10:39am UTC](https://www.ruby-forum.com/t/check-for-which-page-the-helper-is-in/150946/2 "2008-10-15T10:39:39Z")

</div>

On Oct 15, 10:48 am, Hyuuu S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I want to check which controller or action I am currently in, I can  
> access controller.controller\_name but is there a more elegant way to do  
> it?  
> Something like, am\_I\_in {:controller=\>‘user’,:action=\>‘index’} or  
> am\_I\_in ‘/user/index’
> 
> ## Thanks 🙂
> 
> Posted viahttp://www.ruby-forum.com/.

current\_page?(:controller =\> ‘user’, :action =\> ‘index’)
