LearnPulse / app /controllers /help_controller.rb
Nambinintsoa Rovatiana RAMAROSON
first commit
874ae95
Raw
History Blame Contribute Delete
445 Bytes
class HelpController < ApplicationController
before_action :validate_document
# GET /help/:document
def show
@markdown = Rails.root.join('docs', 'served', document_filename).read
render layout: 'student'
end
private
def document_filename
@document_filename ||= params[:document] == "markdown_editor" ? "markdown_editor.md" : nil
end
def validate_document
raise_not_found if document_filename.blank?
end
end