]> git.openstreetmap.org Git - rails.git/blobdiff - app/helpers/title_helper.rb
Update title on pushState, closes #33
[rails.git] / app / helpers / title_helper.rb
diff --git a/app/helpers/title_helper.rb b/app/helpers/title_helper.rb
new file mode 100644 (file)
index 0000000..181c12a
--- /dev/null
@@ -0,0 +1,11 @@
+module TitleHelper
+  def set_title(title = false)
+    if title
+        title = t('layouts.project_name.title') + ' | ' + title
+    else
+        title = t('layouts.project_name.title')
+    end
+    response.headers["X-Page-Title"] = title 
+    @title = title
+  end
+end