How to attach Base64 image to Active Storage object?
问题 I can attach a png image from disc by and everything works just fine: obj.attachment.attach( io: File.open('dog.png'), filename: "image_name", content_type: "image/png" ) But it doesn't work giving result like too tiny empty square when I save a Base64 png image which encoded into String something like that "data:image/png;base64,iVB**..REST OF DATA..**kSuQmCC" by: obj.attachment.attach( io: StringIO.new(encoded_base_sixty_four_img), filename: "image_name", content_type: "image/png" ) Also I