Jeep Gladiator rocklights

The params hash will always contain the :controller and :action keys, but you should use the methods controller_name and action_name instead to access these values

Jeep JK Rocklights

Image

So let's say you have a CSS class active , that should be inserted in any link whose page is currently open (maybe so that you can style differently) . If you have a static_pages controller with an about action, you can then highlight the link like so in your view:

So, now for example I would like to change the p tag in 'home' controller and 'index' action. Inside index.scss file adds.

JL rocklights

(Obviously I could put something like @controller_name = 'users' in each controller; but that seems like the sort of thing Rails would've already done behind the scenes. So I'm just wondering if there's a built-in way.)

For an example of why I would want to know this: if several controllers share the same layout, I may have a part in the layout ERB file where I want to highlight the current page's menu item based on the controller.

Image