Files
fizzy/app/controllers/accounts/join_codes_controller.rb
T
2024-09-24 14:30:22 -04:00

20 lines
444 B
Ruby

class Accounts::JoinCodesController < ApplicationController
def show
respond_to do |format|
format.svg { render inline: qr_code_svg }
end
end
def update
Current.account.reset_join_code
redirect_to account_users_path
end
private
def qr_code_svg
join_url(Current.account.join_code).then do |url|
RQRCode::QRCode.new(url).as_svg(viewbox: true, fill: :white, color: :black)
end
end
end