Commit 4d727640
Changed files (1)
app
controllers
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