Current controller and action in Rails
I found out on #rubyonrails that it’s possible to get the current controller and action through the params[:controller] and params[:action] variables respectively.
These are definitely time savers when you’re building a menu structure based on the current controller and action.
Tags: rails
Add New Comment
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Add New Comment
Trackbacks
(Trackback URL)