I want to create API for upload photo in rails app for android mobile app.
I have no idea about how to create API for photo upload.
def update # scoped to current_user
@user = @current_user
@user.update(:portrait => File.open(params[:portrait], 'rb'))
render action: 'settings'
end
I tried above code to update profile picture but it raises following exception:
Errno::ENOENT (No such file or directory @ rb_sysopen - https://res.cloudinary.com/hmdmd2cr2/image/upload/c_fill,g_face,h_256,w_256/v1525241327/dy8hbwqjedfhtaaycpza.jpg):