diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-04-30 20:06:18 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-04-30 20:12:15 +0300 |
commit | 26ad250989d82b496b131811f8a0ddd7e662b650 (patch) | |
tree | a61059ff97f7d5bb1db163fa2dcb041065b092f2 /app/controllers/help_controller.rb | |
parent | f2cf6d75ecc6082897543f976e8e4bee7ac24e90 (diff) |
Add a page title to every page.
Diffstat (limited to 'app/controllers/help_controller.rb')
-rw-r--r-- | app/controllers/help_controller.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb index 35ece5b270b..b405cc7e689 100644 --- a/app/controllers/help_controller.rb +++ b/app/controllers/help_controller.rb @@ -3,12 +3,12 @@ class HelpController < ApplicationController end def show - category = clean_path_info(path_params[:category]) - file = path_params[:file] + @category = clean_path_info(path_params[:category]) + @file = path_params[:file] respond_to do |format| format.any(:markdown, :md, :html) do - path = Rails.root.join('doc', category, "#{file}.md") + path = Rails.root.join('doc', @category, "#{@file}.md") if File.exist?(path) @markdown = File.read(path) @@ -22,7 +22,7 @@ class HelpController < ApplicationController # Allow access to images in the doc folder format.any(:png, :gif, :jpeg) do - path = Rails.root.join('doc', category, "#{file}.#{params[:format]}") + path = Rails.root.join('doc', @category, "#{@file}.#{params[:format]}") if File.exist?(path) send_file(path, disposition: 'inline') |