No longer used
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
class UploadsController < ApplicationController
|
||||
include ActiveStorage::SetCurrent
|
||||
|
||||
before_action :set_file, only: :create
|
||||
before_action :set_attachment, only: :show
|
||||
|
||||
def create
|
||||
# FIXME: Try to get upload attachments on root
|
||||
@upload = Account.sole.uploads_attachments.create! blob: create_blob!
|
||||
end
|
||||
|
||||
def show
|
||||
expires_in 5.minutes, public: true
|
||||
redirect_to @attachment.url, allow_other_host: true
|
||||
end
|
||||
|
||||
private
|
||||
def set_file
|
||||
@file = params[:file]
|
||||
end
|
||||
|
||||
def set_attachment
|
||||
@attachment = ActiveStorage::Attachment.find_by! slug: "#{params[:slug]}.#{params[:format]}"
|
||||
end
|
||||
|
||||
def create_blob!
|
||||
ActiveStorage::Blob.create_and_upload! io: @file, filename: @file.original_filename, content_type: @file.content_type
|
||||
end
|
||||
end
|
||||
@@ -120,9 +120,6 @@ Rails.application.routes.draw do
|
||||
resources :days
|
||||
end
|
||||
|
||||
resources :uploads, only: :create
|
||||
get "/u/*slug" => "uploads#show", as: :upload
|
||||
|
||||
resources :qr_codes
|
||||
|
||||
get "join/:tenant/:code", to: "join_codes#new", as: :join
|
||||
|
||||
Reference in New Issue
Block a user