Use render svg

This commit is contained in:
David Heinemeier Hansson
2025-04-12 18:15:05 +02:00
parent 120e8da1d5
commit 1b732c41c7
+1 -4
View File
@@ -2,10 +2,7 @@ class QrCodesController < ApplicationController
allow_unauthenticated_access
def show
qr_code_link = QrCodeLink.from_signed(params[:id])
svg = RQRCode::QRCode.new(qr_code_link.url).as_svg(viewbox: true, fill: :white, color: :black)
expires_in 1.year, public: true
render plain: svg, content_type: "image/svg+xml"
render svg: RQRCode::QRCode.new(QrCodeLink.from_signed(params[:id]).url).as_svg(viewbox: true, fill: :white, color: :black)
end
end