Files
fizzy/app/controllers/accounts/join_codes_controller.rb
T
David Heinemeier Hansson 15b0d6e818 Simplify join code svg rendering
There are no other formats, so dont use the multiformat structure, but
prepare for a render svg upstream.
2024-10-19 19:19:12 -07:00

17 lines
433 B
Ruby

class Accounts::JoinCodesController < ApplicationController
def show
render_svg RQRCode::QRCode.new(join_url(Current.account.join_code)).as_svg(viewbox: true, fill: :white, color: :black)
end
def update
Current.account.reset_join_code
redirect_to account_users_path
end
private
# FIXME: Upstream to Rails as render svg:
def render_svg(svg)
render content_type: Mime[:svg], body: svg
end
end