Method: Olivander::ApplicationHelper#page_title

Defined in:
app/helpers/olivander/application_helper.rb

#page_titleObject



19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/helpers/olivander/application_helper.rb', line 19

def page_title
  cf = content_for(:title)
  return cf unless cf.blank?

  controller_key = controller.class.name.underscore
  key = "page_titles.#{controller_key}.#{action_name}"
  return O18n.t(key) if I18n.exists?(key)

  return @page_title if @page_title

  "#{controller_name}: #{action_name}".titleize
end