Add ability to delete invite codes (#153)

* Add ability to delete invite codes

Implemented destroy action in InviteCodesController and updated routes to support invite code deletion. Updated invite code partial to include a delete button and improved styling. Also refactored the generate tokens button in invite code settings to use DS::Button.

* Show advanced settings only to admin users

Updated the settings navigation to display the advanced section only for admin users. Also improved handling of hidden elements in the invite code CSS.
This commit is contained in:
Mark Hendriksen
2025-09-22 09:29:23 +02:00
committed by GitHub
parent b4aa5194e8
commit f3fecc40ba
6 changed files with 54 additions and 28 deletions

View File

@@ -11,6 +11,12 @@ class InviteCodesController < ApplicationController
redirect_back_or_to invite_codes_path, notice: "Code generated"
end
def destroy
code = InviteCode.find(params[:id])
code.destroy
redirect_back_or_to invite_codes_path, notice: "Code deleted"
end
private
def ensure_self_hosted