]> git.openstreetmap.org Git - rails.git/blob - app/helpers/title_helper.rb
Use document.location.protocol for OSRM
[rails.git] / app / helpers / title_helper.rb
1 require 'htmlentities'
2
3 module TitleHelper
4   @@coder = HTMLEntities.new
5
6   def set_title(title = false)
7     if title
8       @title = @@coder.decode(title.gsub("<bdi>", "\u202a").gsub("</bdi>", "\u202c"))
9       response.headers["X-Page-Title"] = t('layouts.project_name.title') + ' | ' + @title
10     else
11       @title = title
12       response.headers["X-Page-Title"] = t('layouts.project_name.title')
13     end
14   end
15 end