Module: Phlexible::PageTitle
- Defined in:
- lib/phlexible/page_title.rb
Overview
Helper to assist in defining page titles within Phlex views. Also includes support for nested views, where each desendent view class will have its title prepended to the page title. Simply include the module and assign the title to the ‘page_title` class variable:
class MyView
include Phlexible::PageTitle
self.page_title = 'My Title'
end
Then call the ‘page_title` method in the <head> of your page.
Class Method Summary collapse
Class Method Details
.included(base) ⇒ Object
17 18 19 20 21 |
# File 'lib/phlexible/page_title.rb', line 17 def self.included(base) base.class_eval do self.class.attr_accessor :page_title end end |