Sha256: 6846774d9390af3ae6562c15508590862f83d82c53cd32b12dcdfb1571cc85ff
Contents?: true
Size: 480 Bytes
Versions: 6
Compression:
Stored size: 480 Bytes
Contents
require_relative "manage" module Octodmin::Controllers::Posts class Upload < Manage include Octodmin::Action expose :upload def call(params) super site = Octodmin::Site.new file = params[:file] dir = File.join(site.source, "octodmin", @post.identifier) path = File.join(dir, file["filename"]) FileUtils.mkdir_p(dir) FileUtils.cp(file["tempfile"].path, path) @upload = path.sub(site.source, "") end end end
Version data entries
6 entries across 6 versions & 1 rubygems