Rails、回形针、反应:不保存图像
Rails, paperclip, react: don't save image
通过 parerclip 保存图像时遇到问题:
https://gist.github.com/pustovalov/9bb21936e1e1371a0da2ce3388877478
有什么解决这个问题的建议吗?
找到答案,需要将 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
通过 parerclip 保存图像时遇到问题: https://gist.github.com/pustovalov/9bb21936e1e1371a0da2ce3388877478
有什么解决这个问题的建议吗?
找到答案,需要将 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