Module: TitleEstuary::InstanceMethods

Defined in:
lib/title_estuary.rb

Instance Method Summary collapse

Instance Method Details

#page_titleString

Get the page title. First checks for a dynamically-set title (set via #page_title= or via content_for :page_title); if none has been set, uses a version from I18n under the key ‘page.title.<controller>.<action>’; if no such value exists, tries to generate a reasonable sane default.

Returns:

  • (String)

    the page title



31
32
33
34
# File 'lib/title_estuary.rb', line 31

def page_title
  return @content_for_page_title if @content_for_page_title.present?
  self.page_title = look_up_or_generate_page_title
end