diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index d5aebe199..39c3c8c83 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -77,9 +77,16 @@ class PhotosController < ApplicationController if photo photo.destroy flash[:notice] = I18n.t 'photos.destroy.notice' + + if photo.status_message_id + respond_with :location => photo.status_message + else + respond_with :location => photos_path + end + else + respond_with :location => photos_path end - - respond_with :location => photo.status_message + end def show @@ -108,7 +115,6 @@ class PhotosController < ApplicationController if current_user.update_post( photo, params[:photo] ) flash.now[:notice] = I18n.t 'photos.update.notice' respond_to do |format| - format.html format.js{ render :json => photo, :status => 200 } end else diff --git a/app/views/photos/_new_photo.haml b/app/views/photos/_new_photo.haml index 4e05430d2..fc6b6477e 100644 --- a/app/views/photos/_new_photo.haml +++ b/app/views/photos/_new_photo.haml @@ -15,7 +15,7 @@ onProgress: function(id, fileName, loaded, total){ - alert(; + }, onSubmit: function(id, fileName){