Is there a way to figure out what the current controller is from within the view?
For an example of why I would want to know this: if several controllers share the s
If you want to use all stylesheet in your app just adds this line in application.html.erb. Insert it inside tag
<%= stylesheet_link_tag controller.controller_name , media: 'all', 'data-turbolinks-track': 'reload' %>
Also, to specify the same class CSS on a different controller
Add this line in the body of application.html.erb
So, now for example I would like to change the p tag in 'home' controller and 'index' action.
Inside index.scss file adds.
.nameOfController-nameOfAction { }
.home-index p {
color:red !important;
}