From 05659fa2dbd85e64cffc59363627829aed7f6230 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 20 Jun 2014 14:45:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B3=A8=E5=86=8C=E5=90=8E?= =?UTF-8?q?=E5=9C=A8=E2=80=9D=E4=BF=AE=E6=94=B9=E8=B5=84=E6=96=99=E2=80=9C?= =?UTF-8?q?=E4=B8=AD=E5=8F=91=E7=8E=B0=E6=88=91=E5=9C=A8=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E6=97=B6=E9=80=89=E6=8B=A9=E7=9A=84=E2=80=9D=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E2=80=9C=E8=BA=AB=E4=BB=BD=E5=92=8C=E5=9C=B0=E5=8C=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E4=BB=A5=E5=8F=8A=E5=AD=A6=E5=8F=B7=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E9=83=BD=E6=B2=A1=E6=9C=89=E4=BA=86=EF=BC=8C=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E5=A1=AB=E5=86=99=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index af848786..085ee0c6 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -143,13 +143,17 @@ class AccountController < ApplicationController end #added by bai - unless @user.id.nil? - ue = UserExtensions.create(:identity => params[:identity].to_i,:technical_title => params[:technical_title], :gender => params[:gender].to_i, :user_id => @user.id, :student_id => params[:no]) - unless params[:province].nil? || params[:city].nil? - ue.location = params[:province] - ue.location_city = params[:city] - ue.save - end + if @user.id != nil + ue = @user.user_extensions ||= UserExtensions.new + #ue = UserExtensions.create(:identity => params[:identity].to_i,:technical_title => params[:technical_title], :gender => params[:gender].to_i, :user_id => @user.id, :student_id => ) + ue.identity = params[:identity].to_i + ue.technical_title = params[:technical_title] + ue.gender = params[:gender].to_i + ue.user_id = @user.id + ue.student_id = params[:no] + ue.location = params[:province] if params[:province] != nil + ue.location_city = params[:city] if params[:city] != nil + ue.save end #end