Module: PageTitleHelper

Defined in:
lib/coadjutor/page_title_helper.rb

Instance Method Summary collapse

Instance Method Details

#page_title(options = {}) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/coadjutor/page_title_helper.rb', line 2

def page_title(options = {})
  app_name          = options[:app_name]          || Rails.
                                                     application.
                                                     class.
                                                     to_s.
                                                     split('::').
                                                     first
  page_title_symbol = options[:page_title_symbol] || :page_title
  separator         = options[:separator]         || ' : '

  if content_for?(page_title_symbol)
    [app_name, content_for(page_title_symbol)].join(separator)
  else
    app_name
  end
end