Check for which page the helper is in


#1

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 :slight_smile:


#2

On Oct 15, 10:48 am, Hyuuu S. 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 :slight_smile:

Posted viahttp://www.ruby-forum.com/.

current_page?(:controller => ‘user’, :action => ‘index’)