diff --git a/app/controllers/fotos_controller.rb b/app/controllers/fotos_controller.rb
index 5a90a22..168e32e 100644
--- a/app/controllers/fotos_controller.rb
+++ b/app/controllers/fotos_controller.rb
@@ -68,8 +68,12 @@ class FotosController < ApplicationController
respond_to do |format|
if @foto.update_attributes(params[:foto])
- format.html { redirect_to gallery_foto_path(@foto.gallery,@foto), notice: 'Foto was successfully updated.' }
- format.json { head :no_content }
+ format.html {
+ render :json => [@foto.to_jq_upload].to_json,
+ :content_type => 'text/html',
+ :layout => false
+ }
+ format.json { render json: {files: [@foto.to_jq_upload]}, status: :created, location: [@gallery, @foto] }
else
format.html { render action: "edit" }
format.json { render json: @foto.errors, status: :unprocessable_entity }
diff --git a/app/views/fotos/_form_bulk.html.erb b/app/views/fotos/_form_bulk.html.erb
index 209be7c..6c2d0a1 100644
--- a/app/views/fotos/_form_bulk.html.erb
+++ b/app/views/fotos/_form_bulk.html.erb
@@ -8,7 +8,7 @@
Add files...
- <%= f.file_field :datei%>
+ <%= f.file_field :datei, :multiple=>true%>
<%= f.input :gallery %>