Input for name should be shown only to anonymous users

This commit is contained in:
Jesus Federico 2016-10-20 00:13:26 +00:00
parent 36d83b99c6
commit 5fecb98d0b
2 changed files with 6 additions and 2 deletions

View File

@ -9,7 +9,7 @@ class UsersController < ApplicationController
# PATCH/PUT /users/1.json
def update
if @user.update(user_params)
redirect_to controller: 'landing', action: 'room', name: @user.username
redirect_to controller: 'landing', action: 'room', id: @user.username
else
render :edit
end

View File

@ -18,10 +18,14 @@
<!-- Join form -->
<div id="landing_page_join">
<form id="join_form" class="form-inline">
<% if current_user.nil? %>
<div class="form-group">
<label for="join_form_name" class="sr-only">Name</label>
<input id="join_form_name" type="text" class="form-control input" id="name" placeholder="Your name" required>
<input id="join_form_name" type="text" class="form-control input" placeholder="Your name" required>
</div>
<% else %>
<input id="join_form_name" type="hidden" value="<%= current_user.name %>">
<% end %>
<button id="join_form_button" type="button" class="btn btn-success" data-url="<%= bbb_join_path(@resource, @meeting_token) %>">Join</button>
</form>
</div>