Sha256: 6374e781327e753163045f7d1282d5c3b18e3f0b78e37430a0edb4abb469ad33
Contents?: true
Size: 570 Bytes
Versions: 16
Compression:
Stored size: 570 Bytes
Contents
require 'kramdown' module Iatelier module Controllers class Ileaf include Iatelier::Action before :checkfile! def call(params) @storage_location = './storage/leaves' + request.path_info.to_s + '.md' puts @storage_location self.body = ::Kramdown::Document.new(::File.open(@storage_location, external_encoding: "UTF-8").read).to_html end private def checkfile! @storage_location = Hanami.root.to_s + '/storage/leaves' + request.path_info.to_s + '.md' halt 404 if !::File.exists? @storage_location end end end end
Version data entries
16 entries across 16 versions & 1 rubygems