Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def update_img
- if params[:file].present? and params[:id].present?
- picture = Picture.find(params[:id])
- picture.update(file: params[:file])
- render json: {message: "success",
- picture_path: picture.file(:square).gsub("s3.", "s3.eu-central-1.")
- }
- else
- redirect_to request.referrer, notice: "You're being redirected"
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement