forked from External/greenlight
add room post
This commit is contained in:
parent
de44d8024b
commit
9e5250353b
|
@ -22,7 +22,7 @@ class RoomsController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET/POST /r/:room_uid
|
# GET /r/:room_uid
|
||||||
def show
|
def show
|
||||||
opts = default_meeting_options
|
opts = default_meeting_options
|
||||||
|
|
||||||
|
@ -34,13 +34,8 @@ class RoomsController < ApplicationController
|
||||||
redirect_to @room.join_path(current_user, opts)
|
redirect_to @room.join_path(current_user, opts)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
# If you're unauthenticated, you must enter a name to join the meeting.
|
# Render the join page so they can supply their name.
|
||||||
if params[:join_name]
|
render :join
|
||||||
redirect_to @room.join_path(params[:join_name], opts)
|
|
||||||
else
|
|
||||||
# Render the join page so they can supply their name.
|
|
||||||
render :join
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
# If the meeting isn't running and you don't own the room, go to the waiting page.
|
# If the meeting isn't running and you don't own the room, go to the waiting page.
|
||||||
|
@ -50,6 +45,16 @@ class RoomsController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 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)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# DELETE /r/:room_uid
|
# DELETE /r/:room_uid
|
||||||
def destroy
|
def destroy
|
||||||
@room.destroy
|
@room.destroy
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
|
|
||||||
|
# Room resources.
|
||||||
resources :rooms, only: [:create, :show, :destroy], param: :room_uid, path: '/r'
|
resources :rooms, only: [:create, :show, :destroy], param: :room_uid, path: '/r'
|
||||||
|
|
||||||
# Room routes.
|
# Extended room routes.
|
||||||
scope '/r/:room_uid' do
|
scope '/r/:room_uid' do
|
||||||
|
post '/', to: 'rooms#join'
|
||||||
get '/start', to: 'rooms#start', as: :start_room
|
get '/start', to: 'rooms#start', as: :start_room
|
||||||
match '/wait', to: 'rooms#wait', as: :wait_room, via: [:get, :post]
|
match '/wait', to: 'rooms#wait', as: :wait_room, via: [:get, :post]
|
||||||
get '/logout', to: 'rooms#logout', as: :logout_room
|
get '/logout', to: 'rooms#logout', as: :logout_room
|
||||||
|
|
Loading…
Reference in New Issue