Module: Titleist::Controller

Extended by:
ActiveSupport::Concern, T::Sig
Defined in:
lib/titleist/controller.rb

Overview

Controller mixins for reading titles without ActionView

Instance Method Summary collapse

Instance Method Details

#app_titleString

Shorthand for calling title.app in the view.

Returns:

  • (String)

    i18n-configured global application title.



25
26
27
# File 'lib/titleist/controller.rb', line 25

def app_title
  title.app
end

#page_titleString

Shorthand for calling title.page in the view.

Returns:

  • (String)

    i18n-configured title for the current page.



32
33
34
# File 'lib/titleist/controller.rb', line 32

def page_title
  title.page
end

#titleTitleist::Title

Generate the full page title for this request. When output into the view, the entire title is shown. You may also call title.page or title.app to view individual pieces of the title.

Returns:



18
19
20
# File 'lib/titleist/controller.rb', line 18

def title
  @title ||= Title.new(**params.to_unsafe_h.deep_symbolize_keys)
end