Module: Reusable::Rails::Controllers::PresentationMethods

Extended by:
ActiveSupport::Concern
Defined in:
lib/reusable/rails/controllers/presentation_methods.rb

Instance Method Summary collapse

Methods included from ActiveSupport::Concern

append_features, extended, included

Instance Method Details

#body_classObject

Return the CSS selector class that should be appended to the <body> element of the associated view.

The default behavior, if unset, is to use the controller name.

(see #body_class=)



35
36
37
# File 'lib/reusable/rails/controllers/presentation_methods.rb', line 35

def body_class
  @body_class || controller_name
end

#body_class=(val) ⇒ Object

Override the CSS class that this view will attach to the <body> element of the associated view.

(see #body_class)



23
24
25
# File 'lib/reusable/rails/controllers/presentation_methods.rb', line 23

def body_class=(val)
  @body_class = val
end

#page_titleObject

Return the page title for the requested action. By default, the CSS selector returned by the body_class method is titleized and used.

(see #body_class)



45
46
47
# File 'lib/reusable/rails/controllers/presentation_methods.rb', line 45

def page_title
  @page_title ||= body_class.titleize
end

#page_title=(val) ⇒ Object

Override the default page title with the specified value.

(see #page_title)



53
54
55
# File 'lib/reusable/rails/controllers/presentation_methods.rb', line 53

def page_title=(val)
  @page_title = val
end