我正在使用carrierwave和cloudinary gems在我的文章模型上附加图像。创建函数工作正常,但当我需要更新现有图像时,我得到以下错误:
‘"image/upload/v1557497204/hqef7unyuvfsva933idv.jpg":String'.的未定义方法’`reject‘
但是,如果我返回并刷新文章页面,新图像就在那里
def update
@article = Article.find(params[:id])
if @article.update(article_params)#the error raised here
flash[:notice] = "Your Article was Created"
redirect_to @article
else
render 'edit'
end
end发布于 2019-05-10 23:53:26
这很可能是由一个已知问题引起的:https://github.com/cloudinary/cloudinary_gem/issues/266
多张图片上传的问题目前看起来还没有解决。
https://stackoverflow.com/questions/56079874
复制相似问题