Included missing assets and fixed room delete 404 (#939)

This commit is contained in:
Ahmad Farhat
2020-01-28 15:31:42 -05:00
committed by farhatahmad
parent 3f8ffa61d7
commit e15e119d5d
2 changed files with 10 additions and 1 deletions

View File

@ -128,6 +128,11 @@ class RoomsController < ApplicationController
else
flash[:success] = I18n.t("room.delete.success")
end
# Redirect to home room if the redirect_back location is the deleted room
return redirect_to @current_user.main_room if request.referer == room_url(@room)
# Redirect to the location that the user deleted the room from
redirect_back fallback_location: current_user.main_room
end