summaryrefslogtreecommitdiff
path: root/app/controllers/help_controller.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-06 13:19:23 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-06 13:19:23 +0300
commit68d146b4a692357354e25d0c0f93edf861b37e8c (patch)
treee2dc8505f4f61c302037cceee093f11c3205ec6e /app/controllers/help_controller.rb
parentb05600f28b39b3bf8f469ca7b293117c65217762 (diff)
downloadgitlab-ce-68d146b4a692357354e25d0c0f93edf861b37e8c.tar.gz
Improve api docs
Diffstat (limited to 'app/controllers/help_controller.rb')
-rw-r--r--app/controllers/help_controller.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb
index b22280d2fd2..2958367e0f8 100644
--- a/app/controllers/help_controller.rb
+++ b/app/controllers/help_controller.rb
@@ -1,4 +1,15 @@
class HelpController < ApplicationController
def index
end
+
+ def api
+ @category = params[:category]
+ @category = "README" if @category.blank?
+
+ if File.exists?(Rails.root.join('doc', 'api', @category + '.md'))
+ render 'api'
+ else
+ not_found!
+ end
+ end
end