module Haml::Helpers::ActionViewExtensions
def page_class
:color #00f
.entry
or to all actions in the entry controller:
:font-weight bold
.entry.show
you could refer to this specific action:
(shown here as Sass),
Then, in a stylesheet
My Div
would become
%div{:class => page_class} My Div
For example, if the current action were EntryController#show,
This can be used to target styles specifically at this action or controller.
unique to this controller/action pair.
Returns a value for the "class" attribute
def page_class controller.controller_name + " " + controller.action_name end