Commit 980a3355 authored by Robert Speicher's avatar Robert Speicher

Use File.join instead of Rails.root.join in HelpController

parent 2941cbb8
...@@ -10,7 +10,8 @@ class HelpController < ApplicationController ...@@ -10,7 +10,8 @@ class HelpController < ApplicationController
respond_to do |format| respond_to do |format|
format.any(:markdown, :md, :html) do format.any(:markdown, :md, :html) do
path = Rails.root.join('doc', @category, "#{@file}.md") # Note: We are purposefully NOT using `Rails.root.join`
path = File.join(Rails.root, 'doc', @category, "#{@file}.md")
if File.exist?(path) if File.exist?(path)
@markdown = File.read(path) @markdown = File.read(path)
...@@ -24,7 +25,8 @@ class HelpController < ApplicationController ...@@ -24,7 +25,8 @@ class HelpController < ApplicationController
# Allow access to images in the doc folder # Allow access to images in the doc folder
format.any(:png, :gif, :jpeg) do format.any(:png, :gif, :jpeg) do
path = Rails.root.join('doc', @category, "#{@file}.#{params[:format]}") # Note: We are purposefully NOT using `Rails.root.join`
path = File.join(Rails.root, 'doc', @category, "#{@file}.#{params[:format]}")
if File.exist?(path) if File.exist?(path)
send_file(path, disposition: 'inline') send_file(path, disposition: 'inline')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment