summaryrefslogtreecommitdiff
path: root/app/controllers/users_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r--app/controllers/users_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index ead989d..eb1cd4c 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -9,7 +9,9 @@ class UsersController < ApplicationController
9 layout 'admin' 9 layout 'admin'
10 10
11 def index 11 def index
12 @users = User.all(:order => "login ASC") 12 @users = User.all(:order => "login ASC").group_by do |user|
13 user.admin? ? :admin : :user
14 end
13 end 15 end
14 16
15 def new 17 def new
@@ -20,6 +22,7 @@ class UsersController < ApplicationController
20 @user = User.new params[:user] 22 @user = User.new params[:user]
21 23
22 if @user.save 24 if @user.save
25 flash[:notice] = "User created #{@user.login}"
23 redirect_to user_path(@user) 26 redirect_to user_path(@user)
24 else 27 else
25 render :new 28 render :new
@@ -31,6 +34,7 @@ class UsersController < ApplicationController
31 34
32 def update 35 def update
33 if @user.update_attributes(params[:user]) 36 if @user.update_attributes(params[:user])
37 flash[:notice] = "Updated user #{@user.login}"
34 redirect_to user_path(@user) 38 redirect_to user_path(@user)
35 else 39 else
36 render :edit 40 render :edit