Class: Title::TitleHelper::PageTitle

Inherits:
Object
  • Object
show all
Defined in:
app/helpers/title/title_helper.rb

Instance Method Summary collapse

Constructor Details

#initialize(controller_path, action_name, context) ⇒ PageTitle

Returns a new instance of PageTitle.



9
10
11
12
13
# File 'app/helpers/title/title_helper.rb', line 9

def initialize(controller_path, action_name, context)
  @controller_path = controller_path
  @action_name = adjusted_action_name(action_name)
  @context = context
end

Instance Method Details

#to_sObject



15
16
17
18
19
20
# File 'app/helpers/title/title_helper.rb', line 15

def to_s
  I18n.t(
    [:titles, controller_name, action_name].join('.'),
    **safe_context.merge(default: defaults)
  )
end