Forum: Ruby on Rails check for which page the helper is in

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3eef68158f000cdd7f5289efe0cb097d?d=identicon&s=25 Hyuuu Setiawan (hyuuu)
on 2008-10-15 04:48
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 :)
23e4fc3add5443f51e55663cfc245d24?d=identicon&s=25 Erol Fornoles (Guest)
on 2008-10-15 10:39
(Received via mailing list)
On Oct 15, 10:48 am, Hyuuu Setiawan <rails-mailing-l...@andreas-s.net>
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')
This topic is locked and can not be replied to.