0
votes

I am using carrierwave and cloudinary gems to attach images on my article model. The create function works ok but when i need to update the existin images i am getting the bellow error :

'undefined method `reject' for "image/upload/v1557497204/hqef7unyuvfsva933idv.jpg":String'.

However if i go back and refresh the article page the new image is there

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
1
The error is more likely raised in your model or your uploader. Please post the model at a minimumengineersmnky
Is this a multiple image upload? How many images are you uploading? How many images are you seeing?Veridian Dynamics
@VeridianDynamics yes is multiple image upload . Model has_many :comments , dependent: :destroy mount_uploaders :image, ImageUploader serialize :image, JSON Up loader ```` class ImageUploader < CarrierWave::Uploader::Base # Include RMagick or MiniMagick support: # include CarrierWave::RMagick # include CarrierWave::MiniMagick include Cloudinary::CarrierWave endCharalambos Pouroutides
Unfortunately, I think you're SOL. I just posted my response based on Cloudinary's gem repo.Veridian Dynamics

1 Answers

0
votes

This may very well be caused by a known issue: https://github.com/cloudinary/cloudinary_gem/issues/266

It looks unsolved at the moment for multiple image uploads.