From a528f8e405df5f8efba444fcb9edef18ed2ca103 Mon Sep 17 00:00:00 2001 From: Sungmin Kim Date: Fri, 30 Aug 2013 10:27:05 +0900 Subject: [PATCH] [Title] Add error message when sign up about exist email account. --- dibs-web/app/controllers/users_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dibs-web/app/controllers/users_controller.rb b/dibs-web/app/controllers/users_controller.rb index 0b830a1..1d02f78 100644 --- a/dibs-web/app/controllers/users_controller.rb +++ b/dibs-web/app/controllers/users_controller.rb @@ -52,6 +52,11 @@ class UsersController < ApplicationController @user.password = change_item[:Password] @user.password_confirmation = change_item[:PasswordConfirm] + if not User.find_by_email(@user.email).nil? then + render :json => { :error => "Already exist email account."}, :status => 406 + return + end + if @user.save create_session(@user.email, @user.password) else -- 2.34.1