修复注册后在”修改资料“中发现我在注册时选择的”学生“身份和地区信息以及学号信息都没有了,需要重新填写。

This commit is contained in:
sw 2014-06-20 14:45:41 +08:00
parent 55b28296a0
commit 05659fa2db
1 changed files with 11 additions and 7 deletions

View File

@ -143,14 +143,18 @@ class AccountController < ApplicationController
end end
#added by bai #added by bai
unless @user.id.nil? if @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]) ue = @user.user_extensions ||= UserExtensions.new
unless params[:province].nil? || params[:city].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 => )
ue.location = params[:province] ue.identity = params[:identity].to_i
ue.location_city = params[:city] 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 ue.save
end end
end
#end #end
end end