diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index d5aebe199065a88856389ff9438ceb26ee42bff7..39c3c8c8329c31541be6e46c180e86b8a0e52097 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 4e05430d2ed6e6fd37ef4bd84511ff193d9c536a..fc6b6477eab27bfa9880ed503c43ac165eb883b9 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){