]> git.openstreetmap.org Git - rails.git/blob - app/helpers/title_helper.rb
DB changes + Related issues added
[rails.git] / app / helpers / title_helper.rb
1 require "htmlentities"
2
3 module TitleHelper
4   def self.coder
5     @coder ||= HTMLEntities.new
6   end
7
8   def set_title(title = nil)
9     if title
10       @title = TitleHelper.coder.decode(title.gsub("<bdi>", "\u202a").gsub("</bdi>", "\u202c"))
11       response.headers["X-Page-Title"] = URI.escape(t("layouts.project_name.title") + " | " + @title)
12     else
13       @title = title
14       response.headers["X-Page-Title"] = URI.escape(t("layouts.project_name.title"))
15     end
16   end
17 end