forked from External/greenlight
redo rooms page
This commit is contained in:
@ -4,6 +4,7 @@ class MainController < ApplicationController
|
||||
|
||||
# GET /
|
||||
def index
|
||||
@user = User.new
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -48,7 +48,7 @@ class RoomsController < ApplicationController
|
||||
# POST /r/:room_uid
|
||||
def join
|
||||
opts = default_meeting_options
|
||||
|
||||
|
||||
# If you're unauthenticated, you must enter a name to join the meeting.
|
||||
if params[:join_name]
|
||||
redirect_to @room.join_path(params[:join_name], opts)
|
||||
@ -57,9 +57,9 @@ class RoomsController < ApplicationController
|
||||
|
||||
# DELETE /r/:room_uid
|
||||
def destroy
|
||||
@room.destroy
|
||||
@room.destroy unless @room == current_user.main_room
|
||||
|
||||
redirect_to root_path
|
||||
redirect_to current_user.main_room
|
||||
end
|
||||
|
||||
# GET /r/:room_uid/start
|
||||
@ -87,7 +87,11 @@ class RoomsController < ApplicationController
|
||||
# GET /r/:room_uid/logout
|
||||
def logout
|
||||
# Redirect the owner to their room.
|
||||
redirect_to root_path
|
||||
if current_user
|
||||
redirect_to current_user.main_room
|
||||
else
|
||||
redirect_to root_path
|
||||
end
|
||||
end
|
||||
|
||||
# GET /r/:room_uid/sessions
|
||||
|
@ -1,5 +1,5 @@
|
||||
class UsersController < ApplicationController
|
||||
|
||||
|
||||
# GET /signup
|
||||
def new
|
||||
@user = User.new
|
||||
@ -9,11 +9,11 @@ class UsersController < ApplicationController
|
||||
def create
|
||||
user = User.new(user_params)
|
||||
user.provider = "greenlight"
|
||||
|
||||
|
||||
if user.save
|
||||
login(user)
|
||||
login(user)
|
||||
else
|
||||
render :new
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@ -25,6 +25,6 @@ class UsersController < ApplicationController
|
||||
private
|
||||
|
||||
def user_params
|
||||
params.require(:user).permit(:name, :email, :username, :password, :password_confirmation)
|
||||
params.require(:user).permit(:name, :email, :password, :password_confirmation)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user