if user.update_attributes(params[:user])
# 2- if info correctly saved, then we display a message to ask wether the user should be reactivated or not
@user = user
- @users = User.find(:all, :conditions => ["active=?", true], :include => 'groups')
+ init_users_list
render :index
else
to_index(user.errors, nil)
end
def index
- @users = User.find(:all, :conditions => ["active=?", true], :include => 'groups')
+ init_users_list
if params[:id]
@user = User.find(params[:id])
else
end
def change_password
- @users = User.find(:all, :include => 'groups')
+ init_users_list
@user = User.find(params[:id])
render :action => 'index', :id => params[:id]
end
render :partial => 'autocomplete'
end
+ private
+
+ def init_users_list
+ @users = User.find(:all, :conditions => ["active=?", true], :include => 'groups')
+ end
+
end