show all rooms

This commit is contained in:
Josh
2018-06-01 17:28:39 -04:00
parent 475646f7c1
commit 11a61180ed
8 changed files with 43 additions and 40 deletions

View File

@ -56,27 +56,17 @@ class RoomsController < ApplicationController
# POST /r/:room_uid
def join
opts = default_meeting_options
puts
puts @room.invite_path
# If you're unauthenticated, you must enter a name to join the meeting.
if params[@room.invite_path][:join_name]
redirect_to @room.join_path(params[:join_name], opts)
redirect_to @room.join_path(params[@room.invite_path][:join_name], opts)
end
end
# DELETE /r/:room_uid
def destroy
# Only delete a room if there is another to fallback too.
if current_user.rooms.length > 1
# Assign a new random main_room if it's the main room.
if @room == current_user.main_room
current_user.main_room = (current_user.rooms - [@room]).sample
current_user.save
end
@room.destroy
end
# Don't delete the users home room.
@room.destroy if @room != current_user.main_room
redirect_to current_user.main_room
end