通过parerclip保存图片有问题: https://gist.github.com/pustovalov/9bb21936e1e1371a0da2ce3388877478
如何解决此问题的任何建议?
答案 0 :(得分:1)
找到答案,需要将base64
转换为img:
#app/models/item.rb
private
def parse_image
image = Paperclip.io_adapters.for(image_base)
image.original_filename = "file.jpg"
self.picture = image
end
http://tutorials.pluralsight.com/ruby-ruby-on-rails/handling-file-upload-using-ruby-on-rails-5-api