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
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
On Oct 15, 10:48 am, Hyuuu S. [email protected]
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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs