Consolidate html page title output logic into helper (#27563)
This commit is contained in:
parent
9b06c0f24a
commit
548bb30b2a
4 changed files with 55 additions and 2 deletions
|
@ -91,6 +91,14 @@ module ApplicationHelper
|
|||
end
|
||||
end
|
||||
|
||||
def html_title
|
||||
safe_join(
|
||||
[content_for(:page_title).to_s.chomp, title]
|
||||
.select(&:present?),
|
||||
' - '
|
||||
)
|
||||
end
|
||||
|
||||
def title
|
||||
Rails.env.production? ? site_title : "#{site_title} (Dev)"
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue