You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Depends on the situation. If the QR codes are non-dynamic then you could just generate them in development and serve them like normal images.
If you're creating dynamic QR codes then you should be able to use an attachment handling gem like Dragonfly or PaperClip.
With Dragonfly it might look something like this ( I won't have time to test it until later )
@my_model.qr_code_att=RQRCode::QRCode.new('http://www.google.com/').to_img.to_string# if that doesn't work@my_model.qr_code_att=RQRCode::QRCode.new('http://www.google.com/').to_img.save("#{Rails.root}/tmp/yada.png")
Like I said I won't have time to test things until later. This was a good question and at the very least I'll be updating the docs with info.
How would I serve up the generated PNG file from a Rails view?
This works using the HTML table method described in rqrcode, but I'd rather use your PNG version:
The text was updated successfully, but these errors were encountered: