Return new user instead of nil to avoid parse errors

This commit is contained in:
benji 2016-02-04 13:45:12 +01:00
parent 53f1a0a44f
commit ccc7b987dd

View file

@ -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 }