Add JSON response for paste-uploads

This commit is contained in:
Christoph Haas 2021-02-20 21:19:15 +01:00
parent a8325e4833
commit 6542ffbc19
2 changed files with 9 additions and 4 deletions

View file

@ -111,8 +111,13 @@ class PackagesController < ApplicationController
# TODO
# if @invalid_images…
# ' #{image.image_file_name} (#{image.errors[:image].join(' and ')})
redirect_to package_path
respond_to do |format|
format.html { redirect_to package_path }
# TODO: send all_errors back as JSON and make Javascript display it in #messages
format.json { render :json => true }
end
# render :details
end