Class: Manage::UsersController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/manage/users_controller.rb

Instance Method Summary collapse

Instance Method Details

#activateObject

POST /manage/users/1/activate



29
30
31
32
# File 'app/controllers/manage/users_controller.rb', line 29

def activate
  @user.confirm!    
  respond_with(@user, :location => manage_users_path)
end

#createObject



13
14
15
16
17
# File 'app/controllers/manage/users_controller.rb', line 13

def create
  @user = User.new(params[:user])
  @user.roles_attributes = @roles
  create! { manage_users_path } 
end

#deleteObject

POST /manage/users/1/delete



47
48
49
50
# File 'app/controllers/manage/users_controller.rb', line 47

def delete
  @user.delete!
  respond_with(@user, :location => manage_users_path)
end

#destroyObject



24
25
26
# File 'app/controllers/manage/users_controller.rb', line 24

def destroy
  destroy!{ manage_users_path }
end

#suspendObject

POST /manage/users/1/suspend



35
36
37
38
# File 'app/controllers/manage/users_controller.rb', line 35

def suspend
  @user.suspend! 
  respond_with(@user, :location => manage_users_path)
end

#unsuspendObject

POST /manage/users/1/unsuspend



41
42
43
44
# File 'app/controllers/manage/users_controller.rb', line 41

def unsuspend
  @user.unsuspend!
  respond_with(@user, :location => manage_users_path)
end

#updateObject



19
20
21
22
# File 'app/controllers/manage/users_controller.rb', line 19

def update
  @user.roles_attributes = @roles
  update!{ manage_users_path }
end