clarion/app/controllers/management/users_controller.rb
2014-09-17 14:23:36 +03:00

21 lines
334 B
Ruby

module Management
class UsersController < ManagementController
before_action :assign_user, only: [:toggle_admin]
def index
@users = User.all
end
def toggle_admin
@user.admin = !@user.admin
@user.save
end
private
def assign_user
@user = User.find params[:id]
end
end
end