I have a base64-encoded JPG in my app, and I'd like to render that image as a JPG in a controller.
I worked this out as soon as I asked the question. Assuming you have the base64 string in @image_data
:
send_data Base64.decode64(@image_data),
:type => 'image/jpeg', :disposition => 'inline'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With