summaryrefslogtreecommitdiff
path: root/app/controllers/help_controller.rb
blob: a4fcd4b29e82bf88cc460b0d17c9f40cb4f412c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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

  def show
    @category = params[:category]
    @file = params[:file]

    if File.exists?(Rails.root.join('doc', @category, @file + '.md'))
      render 'show'
    else
      not_found!
    end
  end

  def shortcuts
  end
end