Commit 4d727640

mo khan <mo@mokhan.ca>
2013-03-06 04:04:51
update json for photos as per jquery-file-upload plugin new schema.
1 parent 80ec18c
Changed files (1)
app
app/controllers/photos_controller.rb
@@ -22,8 +22,8 @@ class PhotosController < ApplicationController
     @photo = @creation.photos.build(attributes)
     if @photo.save
       respond_to do |format|
-        format.html { render :json => [@photo.to_jq_upload].to_json, :content_type => 'text/html', :layout => false }
-        format.json { render :json => [@photo.to_jq_upload].to_json }
+        format.html { render :json => {files: [@photo.to_jq_upload]}.to_json, :content_type => 'text/html', :layout => false }
+        format.json { render :json => {files: [@photo.to_jq_upload]}.to_json }
       end
     else
       render :json => [{:error => "oops... we're sorry but we weren't able to upload your photo."}], :status => 304