【发布时间】:2018-03-08 14:58:37
【问题描述】:
我遇到了将图片上传为 base64 的问题。
回形针版本 5.1.0 或更低版本
一切正常我的模特:
do_not_validate_attachment_file_type :image
has_attached_file :image
我的控制器操作:
def update
current_appointment.update(update_params)
redirect_to check_in_flow.next_step_path
end
private
def update_params
params.require(:appointment).permit(:image)
end
我的参数:
<ActionController::Parameters {"appointment"=>{"image"=>"data:image/png;base64, iVBORw0KGgo..."}, "controller"=>"my_controller", "action"=>"update"} permitted: false>
升级版本后我总是得到:
Paperclip::AdapterRegistry::NoHandlerError:
No handler found for "data:image/png;base64, iVBORw0KGgo..."
有没有人遇到过类似的问题,可能新版本不支持base64了?
回形针版本:5.2.0 或最新
Rails 版本:5.1.4
Ruby 版本:2.3.4p301
【问题讨论】:
标签: ruby-on-rails ruby paperclip