2014-09-17 14:23:36 +03:00
|
|
|
module Management
|
|
|
|
class UsersController < ManagementController
|
2014-09-17 17:48:46 +03:00
|
|
|
before_action :assign_user, only: [:show, :toggle_admin]
|
2014-09-17 14:23:36 +03:00
|
|
|
|
|
|
|
def index
|
|
|
|
@users = User.all
|
|
|
|
end
|
|
|
|
|
|
|
|
def toggle_admin
|
2014-09-17 17:48:46 +03:00
|
|
|
@user.toggle_admin!
|
|
|
|
end
|
|
|
|
|
|
|
|
def show
|
2014-09-17 14:23:36 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def assign_user
|
|
|
|
@user = User.find params[:id]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|