BigW Consortium Gitlab

spam_logs_controller.rb 427 Bytes
Newer Older
1 2
class Admin::SpamLogsController < Admin::ApplicationController
  def index
3
    @spam_logs = SpamLog.order(id: :desc).page(params[:page])
4 5 6
  end

  def destroy
7
    spam_log = SpamLog.find(params[:id])
8 9

    if params[:remove_user]
10 11 12 13
      spam_log.remove_user
      redirect_to admin_spam_logs_path, notice: "User #{spam_log.user.username} was successfully removed."
    else
      spam_log.destroy
14
      head :ok
15 16 17
    end
  end
end