forked from External/greenlight
join page tweaks
This commit is contained in:
parent
4f70c9a8e5
commit
2b0f75e62b
|
@ -74,12 +74,8 @@ class RoomsController < ApplicationController
|
||||||
|
|
||||||
# GET /r/:room_uid/logout
|
# GET /r/:room_uid/logout
|
||||||
def logout
|
def logout
|
||||||
# Redirect the owner to their room.
|
# Redirect the correct page.
|
||||||
if current_user
|
redirect_to @room
|
||||||
redirect_to current_user.main_room
|
|
||||||
else
|
|
||||||
redirect_to root_path
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# POST /r/:room_uid/home
|
# POST /r/:room_uid/home
|
||||||
|
@ -127,12 +123,7 @@ class RoomsController < ApplicationController
|
||||||
|
|
||||||
# Find the room from the uid.
|
# Find the room from the uid.
|
||||||
def find_room
|
def find_room
|
||||||
@room = Room.find_by(uid: params[:room_uid])
|
@room = Room.find_by!(uid: params[:room_uid])
|
||||||
|
|
||||||
if @room.nil?
|
|
||||||
# Handle room doesn't exist.
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Ensure the user is logged into the room they are accessing.
|
# Ensure the user is logged into the room they are accessing.
|
||||||
|
|
|
@ -1,14 +1,10 @@
|
||||||
<%= render 'shared/room_event' do %>
|
<%= render 'shared/room_event' do %>
|
||||||
<%= form_for room_path, method: :post do |f| %>
|
<%= form_for room_path, method: :post do |f| %>
|
||||||
<div class="input-group" style="height: 60px;">
|
<div class="input-group" style="height: 48px;">
|
||||||
<% if current_user %>
|
<%= f.text_field :join_name, class: "form-control main-large", placeholder: "Enter your name!", value: "#{current_user ? current_user.name : ''}" %>
|
||||||
<%= f.submit "Join", class: "btn btn-primary px-7 main-large join-button"%>
|
<span class="input-group-append">
|
||||||
<% else %>
|
<%= f.submit "Join", class: "btn btn-primary px-7 main-large" %>
|
||||||
<%= f.text_field :join_name, class: "form-control main-large", placeholder: "Enter your name!" %>
|
</span>
|
||||||
<span class="input-group-append">
|
|
||||||
<%= f.submit "Join", class: "btn btn-primary px-7 main-large" %>
|
|
||||||
</span>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Reference in New Issue