a1a2125a173f81a72f2b53dcdccecdb3b9322e3f
[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