DB restructure, print page

This commit is contained in:
Jason Jordan
2026-03-13 08:47:13 -04:00
parent 6a068243f4
commit 8c885b3e76
73 changed files with 1362 additions and 325 deletions
@@ -0,0 +1,61 @@
module IdCard
class NetworkLogosController < ApplicationController
# View Methods
def index
end
def show
end
def new
end
def create
file = logo_params["logo_file"]
if file.present? && file.is_a?(ActionDispatch::Http::UploadedFile)
filename = file.original_filename
# binary_data = file.read
binary_data = File.binread(file)
meme_type = Marcel::MimeType.for(file)
networklogo = IdCard::NetworkLogo.create(
filename: filename,
image_data: binary_data,
content_type: meme_type
)
render json: networklogo, only: [:id], status: :ok
end
end
def edit
end
def update
end
def destroy
end
# API Methods
def image
logo_file = IdCard::NetworkLogo.find(params[:id])
puts params[:id]
logo_binary = logo_file.image_data
logo_filename = logo_file.filename
send_data logo_binary,
filename: logo_filename,
disposition: 'inline'
end
private
def logo_params
params.require(:id_card_network_logo).permit(:logo_file)
end
end
end