]> git.openstreetmap.org Git - rails.git/blob - app/helpers/title_helper.rb
Add support for an unversioned 'versions' API call
[rails.git] / app / helpers / title_helper.rb
1 module TitleHelper
2   def self.coder
3     @coder ||= HTMLEntities.new
4   end
5
6   def set_title(title = nil)
7     if title
8       @title = TitleHelper.coder.decode(title.gsub("<bdi>", "\u202a").gsub("</bdi>", "\u202c"))
9       response.headers["X-Page-Title"] = ERB::Util.u(@title + " | " + t("layouts.project_name.title"))
10     else
11       @title = title
12       response.headers["X-Page-Title"] = ERB::Util.u(t("layouts.project_name.title"))
13     end
14   end
15 end