Thursday, July 10, 2014

How to get controller and action name in Rails helper method

In Rails 4 :

    params[:controller]
   
    params[:action]






will give you the name of the controller and the name of the action respectively.