diff options
| author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-07-18 09:37:51 +0200 |
|---|---|---|
| committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-07-18 09:37:51 +0200 |
| commit | bbda05863fa754c8f7302a577e91692ebd411a95 (patch) | |
| tree | 3e55fd0cfb32325c0acca6919c114e5071ed16c8 /app/controllers/help_controller.rb | |
| parent | 17084d42aa4f2a9d58d6b6d30656d5b7cfffe007 (diff) | |
| parent | 65352b5baaf269a609b024fd13efc81e8bbdcefa (diff) | |
| download | gitlab-ce-bbda05863fa754c8f7302a577e91692ebd411a95.tar.gz | |
Merge branch 'master' into refactor/ci-config-move-job-entries
* master: (522 commits)
Fix CI yaml example
Align cancel and retry buttons
Remove deploy to production button
Fix a bug where the project's repository path was returned instead of the wiki path
Don't fail to highlight when Rouge doesn't have a lexer
Revert "Merge branch 'gl-dropdown-issuable-form' into 'master'"
Update tests
Don't fail when Ci::Pipeline doesn't have a project
Don't fail when a LegacyDiffNote didn't store the right diff
Update CHANGELOG
Use cattr_accessor instead duplicating code on NoteOnDiff concern
Fix mentioned users list on diff notes
Don't ask Heather to review documentation MR's
add project name and namespace to filename on project export
navbar_icon was renamed to custom_icon in:
use %(...) and %[...] in favor of %<...>
Fix spec Don't attempt to disable statement timeout on a MySQL DB
Disable statement timeout outside of transaction and during adding concurrent index
Disable PostgreSQL statement timeout during migrations
Add visibility icon
...
Diffstat (limited to 'app/controllers/help_controller.rb')
| -rw-r--r-- | app/controllers/help_controller.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb index 9b5c43b17e2..d3dd98c8a4e 100644 --- a/app/controllers/help_controller.rb +++ b/app/controllers/help_controller.rb @@ -12,13 +12,12 @@ class HelpController < ApplicationController end def show - @category = clean_path_info(path_params[:category]) - @file = path_params[:file] + @path = clean_path_info(path_params[:path]) respond_to do |format| format.any(:markdown, :md, :html) do # Note: We are purposefully NOT using `Rails.root.join` - path = File.join(Rails.root, 'doc', @category, "#{@file}.md") + path = File.join(Rails.root, 'doc', "#{@path}.md") if File.exist?(path) @markdown = File.read(path) @@ -33,7 +32,7 @@ class HelpController < ApplicationController # Allow access to images in the doc folder format.any(:png, :gif, :jpeg) do # Note: We are purposefully NOT using `Rails.root.join` - path = File.join(Rails.root, 'doc', @category, "#{@file}.#{params[:format]}") + path = File.join(Rails.root, 'doc', "#{@path}.#{params[:format]}") if File.exist?(path) send_file(path, disposition: 'inline') @@ -57,8 +56,7 @@ class HelpController < ApplicationController private def path_params - params.require(:category) - params.require(:file) + params.require(:path) params end |
