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
-
#app_title ⇒ String
Shorthand for calling
title.app
in the view. -
#page_title ⇒ String
Shorthand for calling
title.page
in the view. -
#title ⇒ Titleist::Title
Generate the full page title for this request.
Instance Method Details
#app_title ⇒ String
Shorthand for calling title.app
in the view.
25 26 27 |
# File 'lib/titleist/controller.rb', line 25 def app_title title.app end |
#page_title ⇒ String
Shorthand for calling title.page
in the view.
32 33 34 |
# File 'lib/titleist/controller.rb', line 32 def page_title title.page end |
#title ⇒ Titleist::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.
18 19 20 |
# File 'lib/titleist/controller.rb', line 18 def title @title ||= Title.new(**params.to_unsafe_h.deep_symbolize_keys) end |