Module Haml::Helpers::ActionViewExtensions
In: lib/haml/helpers/action_view_extensions.rb

This module contains various useful helper methods that either tie into ActionView or the rest of the ActionPack stack, or are only useful in that context. Thus, the methods defined here are only available if ActionView is installed.

Methods

Public Instance methods

generate_content_class_names()

Alias for page_class

Returns a value for the "class" attribute unique to this controller/action pair. This can be used to target styles specifically at this action or controller. For example, if the current action were `EntryController#show`,

    %div{:class => page_class} My Div

would become

    <div class="entry show">My Div</div>

Then, in a stylesheet (shown here as {Sass}), you could refer to this specific action:

    .entry.show
      font-weight: bold

or to all actions in the entry controller:

    .entry
      color: #00f

@return [String] The class name for the current page

[Source]

    # File lib/haml/helpers/action_view_extensions.rb, line 34
34:       def page_class
35:         controller.controller_name + " " + controller.action_name
36:       end

[Validate]