From 5fecb98d0b8a38413106a3c0a29ca9eaaf404126 Mon Sep 17 00:00:00 2001 From: Jesus Federico Date: Thu, 20 Oct 2016 00:13:26 +0000 Subject: [PATCH] Input for name should be shown only to anonymous users --- app/controllers/users_controller.rb | 2 +- app/views/landing/_join_form.html.erb | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 01a1214e..12cc6c63 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -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 diff --git a/app/views/landing/_join_form.html.erb b/app/views/landing/_join_form.html.erb index 9c7285d3..f3cf610f 100644 --- a/app/views/landing/_join_form.html.erb +++ b/app/views/landing/_join_form.html.erb @@ -18,10 +18,14 @@
+ <% if current_user.nil? %>
- +
+ <% else %> + + <% end %>