aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/help_controller.rb
blob: 4eec0fc75f2c1a1f8105a03f45724f96b30b0c47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class HelpController < ActionController::Base
  layout "application"
  protect_from_forgery
  before_action :set_locale

  def set_locale
    I18n.locale = session[:language] || I18n.default_locale
  end

  def show
    @page = HelpPage.find(slug)
    @toc = HelpPage.find("toc")
  end

  private

  def slug
    params[:slug] or "index"
  end

end