Return new user instead of nil to avoid parse errors
This commit is contained in:
parent
53f1a0a44f
commit
ccc7b987dd
1 changed files with 1 additions and 1 deletions
|
@ -7,7 +7,7 @@ class UsersController < ApplicationController
|
|||
load_and_authorize_resource except: :show
|
||||
|
||||
def show
|
||||
@user = User.find_by(name: params[:id])
|
||||
@user = User.find_by(name: params[:id]) || User.new
|
||||
respond_to do |format|
|
||||
format.html { @transaction = Transaction.new }
|
||||
format.json { render json: @user }
|
||||
|
|
Loading…
Reference in a new issue