Chris's first commit at Fri Jan 28 2011 10:14:32 GMT+0800 (CST)
This commit is contained in:
1 parent
554aa0a95d
commit
19a7d51e60
145 files changed
+12742
-893
No files matched your search
@@ -4,7 +4,7 @@ class Panel::UsersController < ApplicationController
|
||||
before_filter :authenticate_user!
|
||||
|
||||
def index
|
||||
@users = User.all
|
||||
@users = User.all.entries
|
||||
end
|
||||
|
||||
def show
|
||||
@@ -13,7 +13,8 @@ class Panel::UsersController < ApplicationController
|
||||
|
||||
def new
|
||||
@user = User.new
|
||||
@user_attributes = UserAttribute.all
|
||||
@user_attribute_models = UserAttributeModel.all.entries
|
||||
session[:last_page] = get_go_back || panel_users_url
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -27,14 +28,21 @@ class Panel::UsersController < ApplicationController
|
||||
|
||||
def edit
|
||||
@user = User.find(params[:id])
|
||||
@user_attributes = UserAttribute.all
|
||||
@user_attribute_models = UserAttributeModel.all.entries
|
||||
session[:last_page] = get_go_back || panel_users_url
|
||||
end
|
||||
|
||||
def update
|
||||
@user = User.find(params[:id])
|
||||
|
||||
# Update changes to the avatar
|
||||
@user.remove_avatar! if params[:file]
|
||||
@user.avatar = params[:file] if params[:file]
|
||||
|
||||
if @user.update_attributes(params[:user])
|
||||
redirect_to :action => :index
|
||||
else
|
||||
@user_attribute_models = UserAttributeModel.all.entries
|
||||
render :action => :edit
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user