Class: Manage::UsersController
- Inherits:
-
BaseController
- Object
- BaseController
- Manage::UsersController
- Defined in:
- app/controllers/manage/users_controller.rb
Instance Method Summary collapse
-
#activate ⇒ Object
POST /manage/users/1/activate.
- #create ⇒ Object
- #destroy ⇒ Object
- #index ⇒ Object
-
#suspend ⇒ Object
POST /manage/users/1/suspend.
-
#unlock ⇒ Object
POST /manage/users/1/unlock.
-
#unsuspend ⇒ Object
POST /manage/users/1/unsuspend.
- #update ⇒ Object
Instance Method Details
#activate ⇒ Object
POST /manage/users/1/activate
43 44 45 46 |
# File 'app/controllers/manage/users_controller.rb', line 43 def activate @user.confirm! respond_with(@user, :location => manage_users_path) end |
#create ⇒ Object
29 30 31 32 |
# File 'app/controllers/manage/users_controller.rb', line 29 def create @user.attributes = params[:user] create! { manage_users_path } end |
#destroy ⇒ Object
38 39 40 |
# File 'app/controllers/manage/users_controller.rb', line 38 def destroy destroy!{ manage_users_path } end |
#index ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/manage/users_controller.rb', line 19 def index index! do |format| format.csv { send_data(User.to_csv, :filename => "users_#{Date.today}.csv", :type => "text/csv") } format.json do @users = User.with_email(params[:term]).includes(:avatar).select("users.id, users.name, users.email").limit(50) render :json => @users.as_json(:methods => [:avatar_small_url]) end end end |
#suspend ⇒ Object
POST /manage/users/1/suspend
49 50 51 52 |
# File 'app/controllers/manage/users_controller.rb', line 49 def suspend @user.suspend! respond_with(@user, :location => manage_users_path) end |
#unlock ⇒ Object
POST /manage/users/1/unlock
61 62 63 64 |
# File 'app/controllers/manage/users_controller.rb', line 61 def unlock @user.unlock_access! respond_with(@user, :location => manage_users_path) end |
#unsuspend ⇒ Object
POST /manage/users/1/unsuspend
55 56 57 58 |
# File 'app/controllers/manage/users_controller.rb', line 55 def unsuspend @user.unsuspend! respond_with(@user, :location => manage_users_path) end |
#update ⇒ Object
34 35 36 |
# File 'app/controllers/manage/users_controller.rb', line 34 def update update!{ manage_users_path } end |