diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 3412d22d68c6f05db1526dabc8e871d4fff12cfd..547fbe3725ec8c85859810e7a1ab3ea136c8c5f2 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -89,7 +89,10 @@ class StatusMessagesController < ApplicationController @status_message = current_user.posts.where(:id => params[:id]).first if @status_message current_user.retract(@status_message) - render 'destroy' + respond_to do |format| + format.js {render 'destroy'} + format.all {redirect_to root_url} + end else Rails.logger.info "event=post_destroy status=failure user=#{current_user.diaspora_handle} reason='User does not own post'" render :nothing => true, :status => 404