用户信息显示方法修改

api
z9hang 11 years ago
parent 5676770100
commit 890f49eb36

@ -122,7 +122,6 @@ GEM
htmlentities (4.3.2)
i18n (0.6.1)
ice_nine (0.11.0)
iconv (1.0.4)
journey (1.0.4)
jquery-rails (2.0.3)
railties (>= 3.1.0, < 5.0)
@ -172,8 +171,6 @@ GEM
win32console (~> 1.3)
pry-nav (0.2.3)
pry (~> 0.9.10)
puma (2.10.1)
rack (>= 1.1, < 2.0)
rack (1.4.5)
rack-accept (0.4.5)
rack (>= 0.4)
@ -222,7 +219,6 @@ GEM
sass-rails
rmagick (2.13.2)
ruby-openid (2.1.8)
ruby-prof (0.15.2)
rubyzip (1.1.6)
sass (3.3.10)
sass-rails (3.2.6)
@ -273,8 +269,6 @@ GEM
win32console (1.3.2-x86-mingw32)
xpath (2.0.0)
nokogiri (~> 1.3)
zip-zip (0.3)
rubyzip (>= 1.0.0)
PLATFORMS
ruby
@ -297,7 +291,6 @@ DEPENDENCIES
guard-test (~> 1.0.0)
htmlentities
i18n (~> 0.6.0)
iconv
jquery-rails (~> 2.0.2)
kaminari
mocha (~> 1.1.0)
@ -307,15 +300,12 @@ DEPENDENCIES
paperclip (~> 3.5.4)
pry
pry-nav
puma
rack-mini-profiler!
rack-openid
rails (= 3.2.13)
rich (= 1.4.6)
rmagick (>= 2.0.0)
ruby-openid (~> 2.1.4)
ruby-prof (~> 0.15.1)
rubyzip
sass-rails (~> 3.2.3)
seems_rateable!
selenium-webdriver (~> 2.42.0)
@ -323,4 +313,3 @@ DEPENDENCIES
spork-testunit (~> 0.0.8)
therubyracer
uglifier (>= 1.0.3)
zip-zip

@ -1,4 +1,5 @@
class UsersService
include ApplicationHelper
include AccountHelper
#将用户注册的功能函数写这里
#参数约定
@ -36,4 +37,30 @@ class UsersService
@user
end
#显示用户
#id用户id
def show_user
@user = User.find(params[:id])
img_url = url_to_avatar(@user)
gender = user.user_extensions.gender.nil? ? 0 : user.user_extensions.gender
work_unit = ""
if @user.user_extensions.identity == 0 || @user.user_extensions.identity == 1
work_unit = @user.user_extensions.school.name unless @user.user_extensions.school.nil?
elsif @user.user_extensions.identity == 3
work_unit = @user.user_extensions.occupation
elsif @user.user_extensions.identity == 2
work_unit = @user.firstname
end
location = ""
location << @user.user_extensions.location
location << @user.user_extensions.location_city
{:id => @user.id,:img_url =>img_url,:nickname => @user.login,:gender => gender,:work_unit => work_unit,:mail => @user.mail,:location => location,:brief_introduction => @user.user_extensions.brief_introduction}
end
#编辑用户
def edit_user params
@user = User.find(params[:id])
file = params[:file]
end
end

Loading…
Cancel
Save