From da7ed512a89013d97e1b1f87d7ef6136c16864dd Mon Sep 17 00:00:00 2001 From: Dan Stowell Date: Sun, 23 Nov 2014 22:21:57 +0000 Subject: [PATCH] Page titles: put specific page title at the start not the end --- app/helpers/title_helper.rb | 2 +- test/helpers/title_helper_test.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/title_helper.rb b/app/helpers/title_helper.rb index a1a2125a1..e72069ff0 100644 --- a/app/helpers/title_helper.rb +++ b/app/helpers/title_helper.rb @@ -6,7 +6,7 @@ module TitleHelper def set_title(title = false) if title @title = @@coder.decode(title.gsub("", "\u202a").gsub("", "\u202c")) - response.headers["X-Page-Title"] = t('layouts.project_name.title') + ' | ' + @title + response.headers["X-Page-Title"] = @title + ' | ' + t('layouts.project_name.title') else @title = title response.headers["X-Page-Title"] = t('layouts.project_name.title') diff --git a/test/helpers/title_helper_test.rb b/test/helpers/title_helper_test.rb index 11578cc11..97ccd7537 100644 --- a/test/helpers/title_helper_test.rb +++ b/test/helpers/title_helper_test.rb @@ -7,11 +7,11 @@ class TitleHelperTest < ActionView::TestCase assert_nil @title set_title("Test Title") - assert_equal "OpenStreetMap | Test Title", response.header["X-Page-Title"] + assert_equal "Test Title | OpenStreetMap", response.header["X-Page-Title"] assert_equal "Test Title", @title set_title("Test & Title") - assert_equal "OpenStreetMap | Test & Title", response.header["X-Page-Title"] + assert_equal "Test & Title | OpenStreetMap", response.header["X-Page-Title"] assert_equal "Test & Title", @title end end -- 2.39.5