Allow admins to manually confirm users

This commit is contained in:
Nishanth Vijayan 2016-07-02 00:38:43 +05:30
parent 8b831b1977
commit 3eeba6cbb0
4 changed files with 31 additions and 2 deletions

View file

@ -36,6 +36,14 @@ module Admin
def edit; end
def confirm
if @user.confirm
redirect_to admin_users_path, notice: "Confirmed #{@user.name}'s email (#{@user.email})!"
else
redirect_to admin_users_path, error: "Could not confirm #{@user.name}'s email (#{@user.email}). #{@user.errors.full_messages.join('. ')}."
end
end
private
def user_params