Files
gitlabhq/app/controllers/help_controller.rb
T
Dmitriy Zaporozhets be4d340381 Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into ce-to-ee
Conflicts:
	Gemfile.lock
	app/controllers/uploads_controller.rb
	app/models/application_setting.rb
	app/models/project_services/issue_tracker_service.rb
	app/views/projects/services/_form.html.haml
	db/schema.rb
	doc/integration/README.md
	features/steps/groups.rb
2015-03-11 18:41:41 -07:00

26 lines
476 B
Ruby

class HelpController < ApplicationController
def index
end
def show
@category = params[:category]
@file = params[:file]
format = params[:format] || 'md'
file_path = Rails.root.join('doc', @category, @file + ".#{format}")
if %w(png jpg jpeg gif).include?(format)
send_file file_path, disposition: 'inline'
elsif File.exists?(file_path)
render 'show'
else
not_found!
end
end
def shortcuts
end
def ui
end
end