Use House for MD comments

This commit is contained in:
Jose Farias
2024-11-27 18:59:15 -06:00
parent 09b460c8be
commit d556e21287
28 changed files with 592 additions and 8 deletions
@@ -0,0 +1,16 @@
class ActionText::Markdown::UploadsController < ApplicationController
include ActiveStorage::SetCurrent
def create
file = params[:file]
blob = ActiveStorage::Blob.create_and_upload! io: file, filename: file.original_filename, content_type: file.content_type
@upload = Current.account.uploads_attachments.create! blob: blob
render :create, status: :created, formats: :json
end
def show
@attachment = ActiveStorage::Attachment.find_by! slug: "#{params[:slug]}.#{params[:format]}"
expires_in 1.year, public: true
redirect_to @attachment.url
end
end